Redirect /home to home.php

In my WP admin's "Pages" section is a page called "Home" with a URL of /home. This page's content gets called by my index.php file. My problem is the /home page is coming up in search results, or someone could type in /home. Is it possible to redirect /home to index.php (or just "/")?


Plugin to call files from internal instead of external

All my CSS and JS files are called from a path like (let's say my website is `example.com`:               http://example.com/test      How can I make them be called like:               /test      Is there a plugin available for this or something? I'm using the Divi theme from ElegantThemes.


List all sidebar names?

I'm listing all sidebars like that:               global $wp_registered_sidebars;          echo '<pre>';     print_r($wp_registered_sidebars);      echo '</pre>'      So I'm getting something like:               Array     (         [sidebar-1] => Array             (                 [name] => Sidebar #1                 [id] => sidebar-1                 [description] => Sidebar number 1                 [before_widget] =>                  [after_widget] =>                  [before_title] =>                  [after_title] =>             )           (...)          )      But I'd love to display them as a select list, like:               <select>       <option value ="SIDEBAR-ID">SIDEBAR-NAME/option>       <option value ="SIDEBAR-ID">SIDEBAR-NAME/option>     (...)     </select>      Wordpress Codex isn't helpful at all. Thank you!


Redirecting to home-page when saving any edited code

I am in trouble, I need help. Whenever I edit any theme code in my dashboard/appearance/editor and try to save it, the file is not saved and it automatically directs me to the homepage. I don't know why is this happening. I cleared the cache through the W3-Total Cache plugin. A few hours before I did the same process, it was working perfectly. But now some problem is there with WordPress. I also tried this in a different browser, but the same things happens. I am using the latest version of WordPress.


Is there a is_user_logged_in() for multisite?

Is there a is_user_logged_in() function for Wordpress MU / Multisite (3.0+) where I can add in the network site ID like `is_user_logged_in(2)` where `2` would be the site_id? ### Update: After a little digging I came up with the code below. Unfortunately it does not work.               //don't use this. does not work.     function mu_logged_in($blog_id){         switch_to_blog($blog_id);             $status = is_user_logged_in();         restore_current_blog();         return $status;     }      anu's answer and comments are good. also, make sure you have the cookie domain set correctly in the wp-config.php file :)


Modify main loop query for paged and meta key

I try to change the main loop in such a way: I have a meta key for displaying featured items, that should be shown only on the home page of the a blog. I pull them in a code separate from the main loop, something like -               $leading = get_posts('showposts=5&meta_key=_pull_leading3&meta_value=on');               foreach ($leading as $post) :              setup_postdata($post);             //some code to show posts data         endforeach;      Then in the main loop, I want to show only posts that are not assigned as featured, so I alter the main loop with query_posts :               query_posts('posts_per_page=7&paged='.$paged.'&meta_key=_pull_leading3&meta_value=off');      Till here everything is ok. But, I also want that if I go to any other older pages, I will get the featured posts again, if they should be there naturally via the regular order. In this case, since I use the meta values, I don't get them. If I try something like this -               if (is_home() && $paged == '0') {  //$paged value is 0 on 1st page and not 1 !                       query_posts('posts_per_page=7&paged='.$paged.'&meta_key=_pull_leading3&meta_value=off');                                    }           else {             query_posts('posts_per_page=7&paged='.$paged);                     }       Then on page #2 I do get the posts as needed, but i is repeating part of the posts that were on page #1 (home page) (Since in homepage loop I showed only posts that are not featured, so since that part of the posts already shown there, and now should be excluded from page #2). How can I alter the main loop in a way that the main page will show the posts that are not featured, and that the other $paged pages will show posts in a native way, no matter if they are featured or not, and without repeating posts from the previous page? I really hope I succeed to explain my issue... Many thanks, Maor


WordPress's "Text" Format

When using self-hosted WordPress, you have the option of writing in "Visual" or "Text" mode. ![visual and text tabs in WordPress editor](http://i.stack.imgur.com/PCbL0.png) Assuming there's no plugins installed,   1. Is this "Text" format a well defined standard or pseudo standard? (like markdown, textile, etc.)   2. Is there a single place in a plugin-less `3.5.1` WordPress where this text is converted into HTML?   3. If the answer to number 2 is "No", how is this text converted into html?


add_filter multiple times with different addon functions?

I'm adding this filter when the condition is true. Can I add another function on the same filter when the 2nd condition is true or will the last one cancel out the previous one?               if(get_option('my_nofollow_flag'){         add_filter('wp_insert_post_data', 'save_add_nofollow' );     }          if(get_option('my_second_option'){         add_filter('wp_insert_post_data', 'another_function' );     }


P̶l̶a̶c̶e̶h̶o̶l̶d̶e̶r̶ *Default* content in Custom Post Type TinyMCE editor

I know you can customize the ~~placeholder~~ _default_ text of the 'Post Title' field, but is there any way to display placeholder content in the actual TinyMCE post editor? Ideally I'd like to display several paragraphs of HTML formatted content in the editor as a placeholder / instructions.


timestamp and scheduled post irregularities

Update: I've confirmed the problem (that scheduled posts are based on UTC time), now just need advice and background to determine best solution. Questions:   **1)** how WP determines UTC time before calculating local timezone offset (i.e. does it use server OS time or some other source--can't find in codex/googling)   ..which would help me answer.. **2)** is changing server time from UTC to local PST the only/best way to make scheduled posts use the same timezone as WP-time? and   **2a)** are there any potential negative implications to changing server time from UTC to local?   **3)** what's the best way to change server time in an accurate way--when I set a clock, it doesn't have to be exactly right, but I'd be concerned about manually setting the time on a server. Hi all- Problem: First, WP started missing publication of scheduled posts. This seems to be a widely-experienced issue, and I fixed it by using the "missed schedule" plugin. This is probably, but not necessarily, irrelevant background. Soon after a move to a new server, WP started publishing scheduled posts early, which to me, can only point to misconfigured time/date settings somewhere in our stack. Stack: LNMP, one nginx box, one db/memcache/php box (though I didn't, and couldn't, build it) As far as I know, there are 4 places in our stack where time is set/relied upon: in WordPress General Settings (set to PST, but also correctly displays UTC server time), for PHP5 in php.ini (was set to central time where the new server is, but I updated to PST and restarted php-fpm once I realized PHP5 has a timezone setting, decreasing the discrepancy by 2 hours), and each box's OS (both are set to UTC time, which I have been assuming is ok because WP recognizes it as such as can still set its 'own' time). Yet, I'm currently watching something occur that shouldn't be possible. A post was set to publish at 9:30am pst, but published at 1:30am pst instead (9:30am utc). This caused the "published X ago" relative timestamp on the post to count backwards from 8 hours, and then start counting up again at 9:30am pst. To me, this means that while the post scheduler (seemingly) should be looking to the (correctly configured) local WP time (as the frontend is), it's instead using UTC (server) time. Solution options:   A. re-set both boxes' OS, plus PHP, plus all WP blogs to only use utc time, and instruct all editorial to live in UTC.   B. re-set both boxes' OS to PST to match PHP and WP. **It seems like this is probably the solution (since the post published on server/UTC time)** , but I'm a *nix n00b and just want to make sure that I should use 'date -s' and just try to be as accurate as possible, **or if it would be smarter just to leave a host support ticket asking them to sync both servers' times to PST?** (or if there's a better way to be precise about it) What I don't get:   A. Why does the post scheduler disregards "WP time" to make its calculation of when to publish? (update: I think the answer is here: http://codex.wordpress.org/Function_Reference/wp_schedule_event - it parses time via unix timestamp directly, rather than through wp?)   B. Why even have WP settings separating UTC time from local time, if all functions don't calculate time from the same source? Why this is an issue:   We have 15 sites, with primary site users in different timezones. Ideally, they could set WP "local time" per blog, and have all post scheduling and functions rely on that specified time. If scheduling is based on server time, this seems impossible.


How to server wordpress from SSL and non-SSL URLs

I have a standard wordpress installation with no plugins residing in /var/www/blog on my root server. It uses an Apache2, mod_rewrite, mod_ssl and that is configured just fine and works perfectly for anything but Wordpress. My .htaccess is:               <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /          #RewriteCond %{SERVER_PORT} !^443$     #RewriteRule (.*)  http://%{SERVER_NAME}%{REQUEST_URI}     #RewriteCond %{HTTP_HOST} ^somesite.info [NC]     #RewriteRule (.*) https://somesite.info%{REQUEST_URI} [R=301,L]          RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /blog/index.php [L]     </IfModule>      A couple of things are wrong:   * I need http and https, `http://www.` and `https:/www.`   * FF displays my site just fine, Chrome loads the CSS and JS from http:// - that is bad I have added the variables to the wp-config.php:                define('WP_HOME','http:/somesite.info/blog');                                                                                define('WP_SITEURL','http://somesite.info/blog');                                                                                How can I define the variables so that all the 4 possible URL schemes get supported? The shown rewrite conditions in comments make me end up in a redirect loop. My Wordpress is behind a reverse proxy, so I assume the .htacess stuff doesn't fit. Best, ww


change front end menu depending on user login

How can i change my front end menu depending on if the user is logged in or not? For Example: View 1: user is not logged in   menu is : home , about us, testimonials View 2: user is logged in   menu is : dashboard, my profile, support Thanks in advance.


Moving from one host to another - cannot access the dashboard

I'm having a problem with my WordPress installation. I'm trying to move it from one host to another (switching hosting providers for my sites). I was following the instructions given here, and everything went smoothly except for one little thing: I can no longer access the dashboard. Similar to this (unanswered) question: moving server can not login The site works, I can see all the posts, all the uploaded pictures, all the comments and tags - everything is there and available. I just cannot access the dashboard. Password recovery didn't help, and doesn't seem to be the problem. It doesn't complain, just clears the fields when I click "log in" and stays on the login page. Note that the domain name doesn't change, I switched servers, but the domain remains the same. What could be the problem, and how to solve it?


get_posts() seemingly ignoring post_type

I am trying to grab posts of post type "leads" (see below for the code I am using) however the query produced (obtained via debug queries) is including the clause 'where post_type in ("leads", "leads", "product_description", "custom_products")' [[notice leads is there twice]] This leads me to think that somehow something is being hooked into this -- but shouldn't suppress_filters => true prevent this from happening? If that is the case what exactly is going on and how do I limit posts to just "leads" ?                 $args = array(           'numberposts' => 5,           'order' => 'DESC',           'orderby' => 'date',           'post_type' => 'leads',           'post_status' => 'publish',           'post__not_in' => array($post->ID),           'suppress_filters' => true       );       $result = get_posts($args);


Wordpress error when sending comment

I'm using the default comments template. When I send a comment I get the following error message: **Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'wp_set_comment_cookies' not found or invalid function name in /home/mattator/public_html/wp-includes/plugin.php on line 403** **Warning: Cannot modify header information - headers already sent by (output started at /home/mattator/public_html/wp-includes/plugin.php:403) in /home/mattator/public_html/wp-includes/pluggable.php on line 881** couldn't find a call to the funciton 'wp_set_comment_cookies' anywhere in the code. It is noteworthy that despite the error message the comment is being sent properly. Any ideas would be appreciated.


Background of default template showing instead of the background of custom page template

Plugins were not working for my custom page template, found out that I needed to put WP_head() and WP_footer(), so did that and the plugins started to work. But now the background changed to that of the default template. If I remove wp_head(), the custom template's background comes back, but plugins do not work anymore. If I use get_header(), logos, menus,background, etc. floods the custom page template, which I don't want. Please help. ### Edit Custom page template code:               <?php     /*     Template Name: OldSkool     */     ?>                     <meta http-equiv="content-type" content="text/html; charset=utf-8" />      <title>Salesletter Template</title>      <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/OldSkool-src/style.css">          <?php     function mypage_head() {         echo '<link rel="stylesheet" type="text/css" href="'.get_bloginfo('template_directory').'/OldSkool-src/style.css">'."\n";     }     add_action('wp_head', 'mypage_head');     ?>     <?php wp_head(); ?>

          <?php if (have_posts()) : while (have_posts()) : the_post(); ?>                  <?php the_content('Read the rest of this entry »'); ?>                       <?php endwhile; else: ?>
Sorry, no posts matched your criteria.
                  <?php endif; ?>

           <?php wp_footer(); ?>


Excludes posts that don't have attachments in the_content()

I'm trying to write a loop that excludes posts that don't have attachments in their content areas. I've got 200 posts in a custom post type called "students". I need to do a query of all students with a gallery or attachment in their content area. NOT their featured image. Can this be done? This is whats going on with my loop so far. Not working at all, I'm guessing that `$gotimages` isn't outputting posts with attachments... * * * **FINAL EDIT: The loop here works perfectly, the issue that I've found is that you can only assign images once. Which means, if you upload images to a post, then reuse the same images for another post, only the first post image will show. This loop works by association to the post. Re-upload your images for every post to make this work and have unique images.** **EDIT: Using the loop from s_ha_dum♦, this is getting closer to the thing I'm looking for, though it's only pulling one result in the loop.**               <?php     $args = array(        'post_type'      => 'attachment',       'post_mime_type' => 'image',       'post_status' => 'inherit',       'posts_per_page' => -1,       'post_parent__not_in' => array(0),       'meta_query' => array(         array(           'key' => '_thumbnail_id',           'value' => 'x',           'compare' => 'NOT EXISTS'         )       ),       'fields' => 'post_parent'     );     $atts = new WP_Query($args);          $parents = array_unique(wp_list_pluck($atts->posts,'post_parent'));          //var_dump($parents);          // get your students posts     $args = array(          'post_type' => 'student',         'post__in' => $parents     );     $students = new WP_Query($args);          // lets see some results     //var_dump($students->request);     //var_dump($students->posts);          echo '
';          // Looping through the students     // I need to pull a random image from the post' gallery / attachements     // Unsure of how I do this     if ( $students->have_posts() ) {         while ( $students->have_posts() ) {             $students->the_post();                  echo get_the_title();             echo '
';         }     } else {         // no posts found         echo 'No students exist';     }     /* Restore original Post Data */     wp_reset_postdata();      ?>


Looking for Direction regarding Custom Posts

I'm currently working on a community site for a fairly large blog (approx 500,000 uniques/month). I've decided I want to do a Network for all the different portions of the community site to keep the DB load to a minimum. IE: - A site for a user generated recipe site - A site for a user forum (using wordpress) - A site for guest blog posts For the recipe site I was thinking of using a custom post type called recipe. My issue with this is I'd be getting URLS like the following by default: recipes.domain.com/recipe/%post-name% or domain.com/recipes/recipe/%post-name% (depending on whether I use subdomain or subdirectory in my Network). So for option 1 I can remove the Tags I've found the following http://www.ultimatewebtips.com/remove-slug-from-custom-post-type/ OR Wordpress 3.3 custom post type with /%postname%/ permastruct? While this looks good I don't want to add any overhead or have to worry about things breaking when updating wordpress or using a caching plugin. I'm not saying it will, but I just figure messing with the permalink structure might not be such a good idea. For the second option I could just use the default post type as my "recipe" (since I will not be using it for anything else). Doing so I can add a filter like the following:               add_filter( 'gettext', 'change_post_to_recipe' );     add_filter( 'ngettext', 'change_post_to_recipe' );          function change_post_to_recipe( $translated )      {           $translated = str_replace( 'Post', 'Recipe', $translated );         $translated = str_replace( 'post', 'Recipe', $translated );         return $translated;     }      And then use the remove_post_type_support() to remove things I don't need such as 'editor' and 'excerpt'. My only worry with this is that the functions gettext or ngettext would get loaded a ton, and I'd be doing an excessive amount of str_replace. The benefit of using the default post type is that I can use all the default built in functions to do what I need, and chances are most plugins would work fine with this. Any suggestions would be appreciated.


Use Metabox to enter Post Title

I would like to use a custom meta box to build the UI for the post title, instead of the usual field 'title' supplied on WordPress post screens. I've build the meta box, the question is now how to save that field as the post_title. Anyone has done this before?


Placeholders in Jetpack Contact Form

In HTML5 you can use placeholders in your forms to name fields or guide the users. I would like to use this in Jetpack forms but it seems it doesn't support it. You can add a default value like `default="Your name"`, but the user will then have to delete this text before writing. With placeholders the field is cleared when you start writing. Any workarounds in JavaScript maybe?


WP_editor problem

A few days ago I asked this question. Today I started building a new website in which I copied the code of my plugin used at the website from my previous question. And I was surprised when I saw that the exact same code that was bugging at my previous website is working perfectly fine in the new website I'm building. For the people who did not read my previous topic: At my another website WP_editor is opening in the 'Plain text' field. I can type there and use options like Bold, Italic etc. As soon I switch to the Visual tab, my text is deleted just as all the options. All I see is a blanco tab which cannot be edited. The code I'm using to display the editor:                add_action( 'edit_page_form', 'content' );                     wp_editor(                         "Sample",                         'content',                         array( 'textarea_name' => 'content' )                     );      Is someone familiar with this problem or someone who knows a solutions for this? Thanks in advance! EDIT: Getting the following errors: > GET http://www.domain.com/wp-includes/js/tinymce/langs/nl.js?ver=358-23224 > 404 (Not Found) wp-tinymce.php:1 > > Failed to load: http://www.domain.com/wp-includes/js/tinymce/langs/nl.js wp- > tinymce.php:1 > > GET http://www.domain.com/wp- > includes/js/tinymce/themes/advanced/langs/nl.js?ver=358-23224 404 (Not > Found) wp-tinymce.php:1 > > Failed to load: http://www.domain.com/wp- > includes/js/tinymce/themes/advanced/langs/nl.js


List of all theme customizer control types?

I have been looking through the theme customization API documentation and google to simply find out the names of the control types already built in to the theme customizer. More specifically I am looking for what the name is of a simple button. I have tried using the type button and input and I am getting nowhere making geusses. So instead of creating a custom control I am sure their has to be a plain old button but I can't find what it is called. So if anyone knows what it is called or can point me to a list with the control types and their names I would greatly appreciate it.


month name translation

I use the birdtips theme and it formats the post date as               $birdtips_posted = date(__('Y. F j.', 'birdtips'),  strtotime(get_the_time("Y-m-d")));      where Y. F j. is already rewritten to reflect my language. As far as I understand, __ is the translation function, but how can I tell Wordpress that I use Hungarian, and will it translate month names automatically, or I should give the names in a .po file?


get_post_type() and WP_QUERY issue

I am having issue with WP_Query, My scenario: a) Using http://wordpress.org/extend/plugins/countries/ b) Using WP_Query to fetch countries and their codes only. c) resetting query properly. d) using custom post type e) using meta boxes f) using get_post_type() to retrieve the custom post type. Here is code snippet:               $query_args = array(         'post_type' => 'countries',         'posts_per_page' => -1,         'post_status' => 'publish'     );     $countries_query = new WP_Query($query_args);     $countries_array = array();     if ($countries_query->have_posts()):         while ($countries_query->have_posts()) :             $countries_query->the_post();             $country_meta = get_post_custom($post->ID);             $country_code = $country_meta['country_code'][0];             //$countries_array[$country_code] = $post->post_name;             $countries_array[$country_code] = $post->post_title;         endwhile;     endif;     wp_reset_postdata();     /*      * sorting countries alphabatically, keeps keys intact with "ksort"      */     ksort($countries_array);     $GLOBALS['custom_countries'] = $countries_array;      and I am adding meta box to my custom post type, using               if (get_post_type() == 'my_custom_post_type'):      add_my_meta_box_for_custom_post_type();     endif;        and get_post_type() returns "countries" instead of global $post which is in this case my "my_custom_post_type". Is there anything wrong with my code????? Please reply only if you have specific answers not general answers or speculations.


Posts being replaced/deleted

As far as I know this is not theme specific, but something which has just started going weird on my WP site. I'm asking for advice on what could cause this problem. I've set up a site using this theme http://themeforest.net/item/serpent- responsive-social-network-theme/2598368 The theme has a front end posting option so users can register and then post. Everything was going fine until I noticed that one of the posts had disappeared from the front page. By this time there were 7 posts and there should of been 8. I had gotten an email saying that there was a post waiting for moderation, so I went to look at the new post, and even though the text content was different somehow it was using the featured image from the post that had been deleted! At the time I thought it was the author of the deleted post that had come back and changed the original post but it turned out it was a completely new author/post. So that was when I knew something was wrong. I approved that post so I had 8 posts again. Then someone else posted, and I noticed that last post had been deleted! it wasn't anywhere in the admin posts section. I've taken the site offline to try and understand what's going on. As far as I know there is no setting in WP that restricts the number of posts? and it's really weird how it deletes/removes the last post, where could I look in the .php files to find out whats going wrong? Could a plug-in be causing the issue? My site also automatically updated to the latest version just a day ago (3.7.1 I think) could that have issues? Any help is appreciated.


How to use 'Event Manager Shortcodes' plugin via the php code?

I am using Event Manager plugin. I want to use many of the shortcodes via php code. e.g [events_calendar]


Can't play FLV in WordPress website

May be I am asking a stupid question, but I am really stuck that I am unable to play .flv videos directly on my webpage. Since I have VLC media player installed in my computer, it asks for permission to play the video through my VLC media player web plugin. ![FLV Playing Issue](http://i.stack.imgur.com/uPHAK.png) I tried to play the .flv video with JW Player, and it is working properly. But the problem is JW Wordpress uses a shortcode, that is being inserted automatically in description of email newsletter. That is why I am unable to use JW Player also. **I have ffmpeg, flvtool2, flvtool++ installed. Do I need anything else to install via SSH to get .flv play on web?** Any help/suggestions will be appreciated.


How can i do custom author list?

My blog have many author. I can list all author. All Author list:               <ul>     <?php wp_list_authors('exclude_admin=0&optioncount=1&show_fullname=1&hide_empty=1'); ?>     </ul>      But I want to sort in a special way. For Example im currently viewing Tech category page, I want a list of author with these id (3,10,12). I will use this code in sidebar widget. And i need a metabox for select author id. Regards


Fully automated theme install and activation via a plugin

I've managed to get my "semi noob proof" site installer plugin 98% complete, but I'm having a slight issue with the theme activation. The plugin is able to copy the theme into the themes directory fine. However, my switch_theme statement that attempts to set it to the active theme is missing something. I'm using...               function activate_theme(){     switch_theme('my_theme', 'style.css');     }      ...as a trigger statement inside the plugin to activate the newly uploaded theme (its uploaded as part of a function that processes further up in the code from the "activate_theme()" function. My theme, in this instance is called 'my_theme' and that's what I'm using in the theme's style.css I can tell that the switch theme is partially working, since when I click on "Appearance", the default 2010 theme is no longer the active theme, however, the "my_theme" theme is not set to active either. Its as if the process only partially completed and neither 2010 nor my theme are fully activated. So, I still have to manually click "Activate" to finish the process. What could I be missing?


How to add IE6 user agent to w3 total cache

I want to display other simple theme for IE6 visitor by adding Internet Explorer 6 to User Agent Groups in W3 Total Cache plugin. When I add MS IE6 to a specific group I got: > **550 internal server error.** How can I do it then? > Resolved by add in textaera :               msie\ 6\.0      screenshot ![enter image description here](http://i.stack.imgur.com/LKoK9.png)


Example of uninstaller routine to remove all custom theme options from wp_options

All of my theme's custom options are preceeded with "mytheme_" + option. For example, mytheme_color1, mytheme_color2, mytheme_body_font_color, etc... I'd like to create a plugin that uninstalls all of the items in wp_options where the option is preceeded with "mytheme_" If you have a reference or example, please share it. Thanks in advance :-)


Add author section on Author archive posts

I was looking at the section where you click on the author name on the homepage posts. and it says the Archive posts from xxxx authors so I thought of that while ago I found that some website has it and they including the twitter of that author and their bio with the pic this is one of the example I would say http://www.redmondpie.com/author/oliver.haslam/ I'm trying to look for this kind of plugin or maybe I can edit this to have it myself but needed to ask if this been done from some plugin because I couldn't find one all I see is the widget on the sidebar Thanks * * * For more information I have looked from the plugin page and the tags from wordpress official site about author plugin.... none of them are similar to what I want on the above example link. Thanks!


How to remove the comments feed from WP 3.1.1?

I've tried a number of solutions available on the internet, but none seem to work in WP 3.1.1. Thanks!


Portfolio + Blog: multisite or plugin?

I need to display both a portfolio and a blog on a website, and as a relative newcomer to WordPress, I was wondering what the most effective way is to do this: install a plugin, or create a multisite? Essentially for the portfolio page I just need to display a thumbnail, category, and title, but when each entry is clicked, I need a full, blog-style post. Is there a plugin that will do this, or would a multisite (ie, running the Portfolio as a separate blog) be easier?


How can I include the custom field in Woocommerce in my IPN

I use Woocommerce plugin. All works great, I have added a custom field or attribute to a product which is fine and it shows on the products detail page but my problem is getting this data to come through in the PayPal IPN. I'm trying to edit this file:   http://www.phpkode.com/source/s/woocommerce/woocommerce/classes/gateways/paypal/class- wc-gateway-paypal.php Here is the screenshot of the code that maybe needs to change ![enter image description here](http://i.stack.imgur.com/6idDx.jpg)   Need to change script that send "order_id" to PayPal on script to send my custom field to PayPal. That's all. I believe it's easy to do. But how?


Remove Post Page "View Post" Link

I have created a custom post type, but it just to list some data on a page and it doesn't have any single.php. How do i disable so on the post page when i click publish it doesn't show the "View Page" link and also how do i disable the "View" link in the columns for that post type. Thanks


Parent page using wp_dropdown_pages and multiple post types

Is there a way to get wp_dropdown_pages to return a list of multiple post types (including custom) as options for parent_id? I have tried supplying array for 'post_type' but beginning to think its either not possible? Or need to create a custom function to replace the meta box for page-attributes (parent_id) with a select which is built providing a list of multiple post type pages. Ultimate aim is to allow CPT's to be moved around where a user wants them other than be restricted to the same post_type. Want to use differing post types for say example 'brand', 'model', so that if they wanted model to be under brand they could have /{brand}/{model}/ or if they wanted to attached model under a page such as 'special' be /special/{model}/. Don't want to have to just chuck everything under one post_type as thats probably counter productive and lazy.


Displaying different posts Via wp_list_categories()

I believe this problem to be quite simple but can't seem to get my head around how to solve it. So I'm pulling in all the category with posts in using `wp_list_categories();` My problem is when I click through it pulls in the correct posts but, I want it to pull in the correct posts and still have wp_list_categories links at the top so someone can switch between the posts. So really all that needs to change is that when you click a category link the relevant posts get pulled looking the same as there displayed now. I know this is going to involve conditions and maybe some new queries written - I want to try and do this in the most robust way possible. Link to the page code at the moment generating this page.               <?php     /*      *  * Template Name: Case Studies      */     ?>     <?php global $up_options, $post, $paged, $wp_query; ?>     <?php get_header(); ?>
             <?php $args = array(                 'title_li'           => __( '' ),             ); ?>
<?php wp_list_categories($args); ?>

Case Studies
               <?php         $start = $wp_query;         $wp_query = null;         $wp_query = new WP_Query();           $wp_query->query('posts_per_page=5&post_type=post'.'&paged='.$paged);             while ($wp_query->have_posts()) : $wp_query->the_post();                          ?>                         <div id="post-<?php the_ID(); ?>" class="post">                             <a href="<?php the_permalink() ?>">                                 <?php if (has_post_thumbnail()) { ?>                                     <?php the_post_thumbnail('thumbnail'); ?>                                 <?php }?>
<a href="<?php  echo get_post_meta($post->ID, 'lj_file_url', true) ?>" title="<?php the_title(); ?>"> <?php the_title(); ?>

     <a href="<?php  echo get_post_meta($post->ID, 'lj_file_url', true) ?>" title="Download pdf <?php the_title(); ?>">                                  <?php the_excerpt(); ?>

                     <?php endwhile; ?>
                         <?php wpld_pagenavi(); ?>

Secure Solutions

         <?php get_footer(); ?>


User cannot authenticate after signup when object cache enabled

I've just upgraded to WordPress 3.5.1 and the new `object-cache.php` version 2.0.2 that users some new switch to blog cache functionality. We had this issue with the previous version of object cache, but i managed to solve it by delete the users keys when doing signup and activation of the blogs. This cleared the cached password from memcache, that for some reason is wrong. I tried re-implement this, but it does not work. I've put this code in my register page:               wp_cache_key_delete("4e76434eea3c9d9cf9cb10bbf3f4a74b92:users:1");      wp_cache_delete('users');      the hash is my KEY SALT and again on the activation page I use this               wp_cache_key_delete("4e76434eea3c9d9cf9cb10bbf3f4a74b92:users:".$user_id);     wp_cache_delete('users');      This should clear the cached users and their password, so auth will happens against the password in the MySQL database. I added these 2 functions to `object-cache.php` to handle they key deletion #hack by tonny               function wp_cache_key_delete($key) {         global $wp_object_cache;                return $wp_object_cache->key_delete($key);     }      and this                   function key_delete($key) {                      $mc =& $this->get_mc($group);                      $result = $mc->delete($key);                      @ ++$this->stats['delete'];                 $this->group_ops[$group][] = "delete $id";                      if ( false !== $result )                         unset($this->cache[$key]);                      return $result;         }      Has any of you had similar issues with users not beging able to login when signing up / registering a blog ?


Incorrect 404 for pages when using permalink, a static front page, and posts page

I am having an issue with my permalink setup, which I think has to do with my setup, rewrite rules, and more. Under Settings->Reading, we have a static Front Page set as well as a Posts page (Home and News, respectively). Under Settings->Permalinks, I have a custom one set up as `/news/%postname%/`. Basically, I want my url to look like this for an article: `http://www.company.com/news/a-news-article/`. I want `http://www.company.com/news/` to take me to my articles. As of right now, this is 90% there. What I noticed is that if I go to `http://www.company.com/news/not-a-post/`, where `not-a-post` is not created, I get a 404. But, if I go to `http://www.company.com/asdf`, I would expect a 404. Instead, it loads the front page (the static front page). For our setup, we are using the roots theme as a base, and not using htaccess, everything is in the httpd.conf. Our rewrite rules look like this:               RewriteRule ^/index\.php$ - [L]     RewriteRule ^/css/(.*) /wp-content/themes/thetheme/css/$1 [QSA,L]     RewriteRule ^/js/(.*) /wp-content/themes/thetheme/js/$1 [QSA,L]     RewriteRule ^/img/(.*) /wp-content/themes/thetheme/img/$1 [QSA,L]     RewriteRule ^/font/(.*) /wp-content/themes/thetheme/font/$1 [QSA,L]     RewriteRule ^/plugins/(.*) /wp-content/plugins/$1 [QSA,L]     RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f     RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]      When I enabled logging, it says that it sent it to index.php, which should be right. But why doesn't index.php handle this 404 correctly? If I use the 'Day and Name' option from permalinks, everything looks and works right. It also appears that if I use `/news/%year%/%monthnum%/%day%/%postname%/`, it works as it should too. Why won't it work with just `/news/%postname%/`?


Display random post on a page with post permalink in URL

I have seen many snippets to display random post/posts on a page. Most of them provide a function or wp_query code to be directly placed where it is required. In the end they tell to create a template random.php and page with name RANDOM. So, when one wants to access that page, they can look for a link pointing as http://domain.com/random/. And every time, I find the same URL -->http://domain.com/random/. What I want is to display the URL of the post i.e permalink in the address bar, whenever one clicks on random page link e.g post-permalink. I use this piece of code.                   query_posts(array(         'showposts' => 1,         'orderby' => 'rand',         ));     if (have_posts()) : while (have_posts()) : the_post();      I don't know much about using 'base' and 'format' arguments in the array, they might serve purpose. Thanks


Give editor ability to edit custom settings without access to Main Settings

I have created a custom settings page that I've positioned in tools > Custom Settings               add_action('admin_init', array('siteSettings', 'register'));     add_action('admin_menu', array('siteSettings', 'menu'));          $page = add_management_page(PLUGIN_NICK.' Plugin Options', PLUGIN_NICK, 'delete_posts', PLUGIN_ID.'_options', array('siteSettings', 'showPage'));          <form action="options.php"      The form posts to options.php (even though I've put it in tools menu), and the editor role gets permission died when trying to update the form, although they can access the form without errors, they just can't save. I fixed this with               $editor = get_role('editor');     $editor->add_cap('manage_options');      However this gives them menu items; Appearance, Settings, and all other admin menus created by plugins which I don't want (I only want them to be able to access things in Tools which they had before). Thanks!


how to debug shipping module / class

I'm working on an own shipping module and want to print some arrays. But, the module is operating in the background, so I can not print the arrays. Is there a way?


Add_menu_page and saving settings

I am working on an WP plugin and have my settings in a created menu page. When I save the page my settings are saved without any problems, but I don't return to the settings page but to a page where you can see all settings that exists in WordPress. How can I return the user to my own settings page? I post to `options.php` as described in the help docs.


Jetpack Subscriptions - How to make box and button on one line?

If you look at my site in the sidebar, you will see that the entry box (where people enter their email) and the submit button are on 2 different lines. I would liek them to be on one line like in the Search widget a few widgets down. I tried to edit the subscriptions.php file with no success. Please help! It's such an eye sore!


Jetpack could not contact wordpress

I recently created a site and installed Jetpack and activated it, but it gives me the following error: > Jetpack could not contact WordPress.com: register_http_request_failed. This > usually means something is incorrectly configured on your web host. Failed > to connect to 76.74.254.123: Permission denied


Issue with contextual help overwriting existing content

I'm missing something here:               function page_help($contextual_help, $screen_id, $screen) {          if ($screen_id == 'page') {              $contextual_help = '
Shortcodes

Shortcodes help
         '.$contextual_help;              return $contextual_help;     }          elseif ($screen_id == 'post') {              $contextual_help = '
Post help

Help is on its way!
         '.$contextual_help;              return $contextual_help;     }     }                 add_filter('contextual_help', 'page_help', 10, 3);      The code is inserting into the correct screens but I am having two issues:   1. The code is inserting at the top, I'd like it at the bottom.   2. The code is deleting the help from all other screens except those mentioned above. Thanks in advance for your tips! Niels


get term archive url / link

I created custom post types & custom taxonomies for these. Example: `actors` (taxonomy) for `movies` (post type). Now I want to show up in my widget some terms and a `more` link for the `actors` terms archive. So guys, How do i get the taxonomy archive link / url? PS.: Need some code? Request it the Comments.


Multiple columns in add/edit post/page?

If you go to the WP main Dashboard page, the screen options allow you to have 1-4 columns for the screen layout. When you get to the Add/Edit Post/Page pages (/wp-admin/post-new.php and /wp- admin/post-new.php?post_type=page), the max columns you get to pick is only 2. For someone who has several custom taxonomies, fields and meta boxes, it would be really useful if I could choose maybe 3 or 4 columns instead of having to scroll down each time to select from custom options. If this is possible, please point me. I would be very, very grateful! I've searched and found nothing on this.


Plugin to restrict login and unpublish content from an author

I am looking for a plugin or a code that will allow admin to select an author and "ban" him from logging in the system and also to unpublish his posted content until the admin decide to allow the entrance again. This should include posts, author page and comments if it is possible. Thank you for your replies.


dropdown menu, with walker

I'm using the following walker to create a dropdown menu that I will use on a mobile version of a project I'm working on... it works fine, however, when I select the page, it doesn't load the page, what am I missing?               class Walker_Nav_Menu_Dropdown extends Walker_Nav_Menu{         function start_lvl(&$output, $depth){           $indent = str_repeat("\t", $depth); // don't output children opening tag (`<ul>`)         }              function end_lvl(&$output, $depth){           $indent = str_repeat("\t", $depth); // don't output children closing tag         }              function start_el(&$output, $item, $depth, $args){           // add spacing to the title based on the depth           $item->title = str_repeat(" ", $depth * 4).$item->title;                parent::start_el(&$output, $item, $depth, $args);                // no point redefining this method too, we just replace the li tag...           $output = str_replace('<li', '<option', $output);         }              function end_el(&$output, $item, $depth){           $output .= "</option>\n"; // replace closing </li> with the option tag         }     }      Thanks in advance.


Is there a straight-forward way to iterate over all shortcodes in a post?

I'm working with a shortcode `[translate lang=eng]Apple[/translate]` which will be shown only if the "current language" is `eng`. If the post contains, in addition to the above, the declaration `[translate lang=rus]Яаблоко[/translate]` and the current language is neither `rus` nor `eng`, neither of `Яаблоко` or `Apple` is printed. My objective is to print the message in the default language when current language does not match that of the `[translate lang]` attribute. This implies that the message (in the default language) will be printed as many times as `[translate]` is used in the post, but that's for me to worry about... What I need to know is if there is a `get_shortcodes()` function what will give me an `array` (or whatever) of all shortcodes in the post. Would I have to parse the post with regex if not? Do you have better suggestions? _Please refrain from telling me about "superior" translation plugins._


The Tags are not displaying when creating a post

When creating a post, there is not an option to designate tags for that post. There is still a checkbox for displaying tags under "Screen Options," and when checked, it still does not display. It is possible to add tags after the post has been created with "quick-edit," where an input field shows up where you can add/edit tags. What files should I be looking in to get to the bottom of the problem? Is there possibly something I could be missing? I know there is relatively little background information in this question, but any help would be appreciated.


Custom Post Type Base URL

Is it possible to not use the loop for the base URL of a custom post type. So for instance if my custom post type is 'directory'. I don't want http://www.mysite.com/directory/ to land at the loop page, I want to make a custom page template that will serve a customised layout for proceeding into areas of the custom post type, based on taxonomies etc. However for a single post I do still want to keep the custom post type name in the URL. So - http://www.mysite.com/directory/listing_type/listing_locale/postname/ If anyone could help with this, i'd much appreciate it. Edit - post creation snippet               register_post_type( 'directory',             array(                 'labels' => array(                     'name' => __( 'Directory Listing' ),                     'singular_name' => __( 'Directorys' ),                     'add_new' => __( 'Add directory listing' ),                     'add_new_item' => __( 'Add directory listing' ),                     'edit' => __( 'Edit' ),                     'edit_item' => __( 'Edit Directory' ),                     'new_item' => __( 'Add a directory listing' ),                     'view' => __( 'View Directory' ),                     'view_item' => __( 'View Directory' ),                     'search_items' => __( 'Search Directorys' ),                     'not_found' => __( 'No Directory found' ),                     'not_found_in_trash' => __( 'No Directory found in Trash' ),                     'parent' => __( 'Parent Directorys' ),                 ),                 'public' => true,                 'query_var' => true,                 'menu_position' => 35,                 'show_ui' => true,                 'supports' => array('title','thumbnail','page-attributes','revisions'),                 'publicly_queryable' => true,                 'exclude_from_search' => true,                 'hierarchical' => true             )         );


How to customize TinyMCE4 in WP 3.9 - the old way for styles and formats doesn't work anymore

Before WP 3.9 i had the following two filters applied in the functions.php:               function my_mce_buttons_2( $buttons ) {         array_unshift( $buttons, 'styleselect' );         return $buttons;     }     add_filter('mce_buttons_2', 'my_mce_buttons_2');          function mce_mod( $init ) {         $init['theme_advanced_blockformats'] = 'p,h3,h4';         $init['theme_advanced_styles'] = "Header gross=mus-bi news-single-bighead; Header klein=mus-bi news-single-smallhead; Link=news-single-link; List Items=news-single-list";         return $init;     }     add_filter('tiny_mce_before_init', 'mce_mod');      so that the paragraph formats dropdown only shows p, h3 and h4 while the custom styles dropdown shows "Header gross", "Header klein" and so on. But unfortunately wp and tinymce don't bother anymore since wp 3.9, i only see the standard paragraph formats dropdown now ![paragraph](http://i.stack.imgur.com/f8rgP.png) as well as the standard styles format dropdown: ![styles](http://i.stack.imgur.com/9OEO6.png) So far i haven't found any docs about if any hooks have changed with the update to tinymce 4. Anyone knows? Best regards Ralf Update: Ok based on a little more research and the comments beneath i guess i've figured things out:               //Creating the style selector stayed the same     function my_mce_buttons( $buttons ) {        array_unshift( $buttons, 'styleselect' );        return $buttons;     }     add_filter('mce_buttons', 'my_mce_buttons');          function mce_mod( $init ) {        //theme_advanced_blockformats seems deprecated - instead the hook from Helgas post did the trick        $init['block_formats'] = "Paragraph=p; Heading 3=h3; Heading 4=h4";             //$init['style_formats']  doesn't work - instead you have to use tinymce style selectors        $style_formats = array(         array(             'title' => 'Header 3',             'classes' => 'mus-bi news-single-bighead'         ),         array(             'title' => 'Header 4',             'classes' => 'mus-bi news-single-smallhead'         ),         array(             'title' => 'Link',             'block' => 'a',             'classes' => 'news-single-link',             'wrapper' => true         )        );        $init['style_formats'] = json_encode( $style_formats );        return $init;     }     add_filter('tiny_mce_before_init', 'mce_mod');


Displaying page image in the footer automatically

I've got the following problem: each page of the site has its own image which needs to be placed within the footer div for correct, static placement. However each image is different so I can't just add a simple IMG tag to the footer. At the moment I've stripped the page.php of most of the content and placed it into the page code itself. So basically Loop closes half-way through the footer area, once the image is loaded. This also means the Loop starts before the content div. However, if an editor uses TinyMCE rather than code view, then DIV tags are re-arranged by Wordpress and the footer is broken. I can't disable the visual editor completely as not all site users know basic HTML. Is there a way to specify this image name as a custom field for each page, then store the value in a separate variable when Loop is running, then display the variable in the footer, after the Loop is closed? I couldn't find any PHP examples of how to get this done so far. Any suggestions would be very welcome! Thanks, Tara


How can I add a field to make link nofollow to the WordPress Link Inspector Window?

The default WordPress insert/edit link inspector window has options for URL, Target, Title and Class. I would like to add a checkbox labeled " **Make link nofollow** " that, when checked, adds _rel="nofollow"_ to the link. It would also need to know if the link already has nofollow and default to checked in the case of a link edit. Is there an existing filter or action to hook into this dialog to add the required bits?


Can I Update WordPress 2.9.2. to 3.0.4 from admin

I have wordpress site that built in WordPress 2.9.2. I want to update this version in admin its give option for update old version to new that is `update to 3.0.4`.Can I do that without data loss.I am worried because of my database because this site is working. Please provide me your suggestion.I shall be very thankful to you all Thanks Shalu


Style RSS Feed for a human?

I have a client who is asking to format the RSS feed so the XML doesn't look so ugly. I was thinking of a plugin or something to detect the user-agent and modify the feed template based on a regular browser request as opposed to a reader that will need the raw XML. Does it sound like I'm on the right track? I was going to use something like feedburner, but this site has many authors and they add new ones all the time and don't want to have to setup something at feedburner for every new feed they get.


How to filter content on Save/Publish to add rel="nofollow" to all external links?

I'm looking for a plugin or example of code that can intercept the save/publish event and verify that all external links within the post content have rel="nofollow" attributes. Is it possible to use add_filter or add_action on the post save/publish event?


Make a select list of a custom post type in a meta box

Simple you will say? I have a first Custom post type called Country. I have a second Custom post type called Travellers. I need to make a drop down select list (multiple check) available when editing Countrywith content from Travellers. This will allow me to select travellers for each country. Help! thx in advance


Fire a hook programmatically

Is it possible to fire a wordpress hook programmatically? Specifically I'd like to have control of wp-insert-post.


Looking for a hook for post.php

First time posting here... I am trying to figure out if there is a hook or action that I can use when a user goes to wp-admin/post.php... Basically when the user goes to post.php I want to check if there is a &from=1 variable and add that to post_meta Thanks!               $from = $_GET['from'];     $post_id = $_GET['post'];     if($from == 1){       add_post_meta($post_id, 'EDITED', 'true');     }


Domain Change with New Image Sizes

I am migrating domains and redesigning the site at the same time. My large image sizes are different than they were before. When I imported the old posts, I had it download all the images as well. My problem is that the images that were inserted with the old file size name. Is there a way to replace all of the images with the correct new image sizes? I just want it to use the default 'large' size, even though it is different than the original site. In post html:   Screen-shot-2010-11-30-at-8.03.27-PM-540x287.png Actual image sizes:   Screen-shot-2010-11-30-at-8.03.27-PM-525x279.png   Screen-shot-2010-11-30-at-8.03.27-PM-615x327.png


get_avatar not working

I'm working on a plugin for showing users via shortcode by their role (in this site's case - authors). I'm getting a list of user objects using a WP_User_Query statement, then creating the output for each user like this:               foreach ( $users as $user ) { ?>

<?php get_avatar( $user->user_email, 150 ); ?>

<?php                         echo 'user_login . '">' . $user->display_name . ' ( ' . $user->age . ' ) - ' . $user->classification . ' from ' . $user->hometown . '
';                         echo 'Major: ' . $user->major;                         echo ( empty( $user->minor ) ? '' :  ', Minor: ' . $user->minor . '' ); ?>

<?php echo $user->user_description; ?>

                  <?php } // End of $users foreach      All the data from the user's profile comes out just fine, except the avatar. I've tried using $user->ID instead of email, but that doesn't work either. I know both the email and ID are called correctly because I can echo them onto the page and see them, so it's not that the data isn't getting to the get_avatar function. What am I doing wrong with get_avatar? I know some of the authors have avatars because I can see them on the Users list, but not on the output page. Ideas?


How to upload files with Media File Manager Advanced?

On my Wordpress I installed a plugin: http://wordpress.org/plugins/media-file- manager-advanced/. I wanted to upload some `*.html` files into my blog using this plugin by dragging and dropping them. But every time I tried to drag my `*.html` file and drop it into the Media File Manager Advanced, my `*.html` just opened on my browser window instead of uploading ... How can I solve such issue? I have more `*.html` files to upload ...


How do I create a dynamic page?

I want to create something similar to what buddypress does with member pages. For eg; http://www.example.com/members/foo http://www.example.com/members/bar etc. I tried looking up the buddypress code and I see that they don't use custom post type or a custom taxonomy. It also doesn't look like they are using add_rewrite_rule() too. I would like to have something similar, where my plugin will take 'foo' from the URL and generate content on basis of that. What's the best way to do it? **UPDATE:** I followed instructions on this thread, which is exactly what I wanted: How to create a front end user profile with a friendly permalink Here's the code:                   add_filter( 'query_vars', 'analytics_rewrite_add_var' );     function analytics_rewrite_add_var( $vars )     {         $vars[] = 'analytic';         return $vars;     }     function add_analytic_rewrite_rule(){         add_rewrite_tag( '%analytic%', '([^&]+)' );         add_rewrite_rule(             '^analytics/([^/]*)/?',             'index.php?analytic=$matches[1]',             'top'         );     }     add_action('init', 'add_analytic_rewrite_rule');     add_action( 'template_redirect', 'analytics_rewrite_catch' );     function analytics_rewrite_catch()     {         global $wp_query;              if ( array_key_exists( 'analytic', $wp_query->query_vars ) ) {             include ( get_stylesheet_directory() . '/html/analytics.php');             exit;         }     }      However, /analytics/foo/ still gives me a 404. What am I doing wrong?


Seeking recommendations on Gallery plugins , specifically captioning thumbnails

I am looking for a gallery plugin that will display thumbnails on a page with captions beneath them, and still allow them to click through to fullsize images, preferably with a slideshow mode allowed. I did try the NextGen plugin but despite adding the captions to my pictures they were only displayed in full size view, not on the thumbnails. The images in use are all different source sizes and dimensions in case this makes any difference. Thanks


Used wordpress built-in permalink to change post url but the page is not found. I used the custom url option and appended /%postname%/ to it but it isn't working. What apart from this I have to change? Thank you in advance.


Pagination in wp query with transient api

I have intergrated wordpress transient system with w3 total cache. Now i can`t to do pagination for this query.                               <?php                     $paged1 = (get_query_var('paged1')) ? get_query_var('paged1') : 1;                     $recent1 = get_transient( 'recent1' );                                         if ( false === $recent1) {        $recent1 = new WP_Query ('cat=3&posts_per_page=5'.'&paged='.$paged1);        set_transient('recent1', $recent1, 60*60);        }        // do normal loop stuff        if ($recent1->have_posts()) : while ($recent1->have_posts()) : $recent1->the_post();        ?>
<a href="<?php the_permalink () ?>" rel="bookmark">
<?php the_title (); ?>
     <?php the_post_thumbnail(array(100,100), array('class' => 'alignleft')); ?>     <?php the_advanced_excerpt(); ?>
<?php endwhile; ?><?php endif; ?><?php wp_reset_query(); ?>


I am new in WordPress i am rails programmer that need to do for small Business only WordPress website with : main page, about us, contact + few articles(posts) that will be in the main page "about us", " contact" sections should be article(post) or page in the simple small Business website? Thanks,


How do I remove an action hook by s2member

I noticed that my plugin doesnt work when s2member is activated but unfortunately it is needed for the site functionality, i did some research if I comment out this line on hooks.inc.php then my plugin works, how can I remove it from my plugin ? because once s2member is updated it removes my // and we are back with the same issue. this is the line:               //add_action("wp_login", "c_ws_plugin__s2member_login_redirects::login_redirect", 10, 2);      I looked up the codex and found this function :               <?php remove_action( $tag, $function_to_remove, $priority ); ?>      would that work for what I am trying to accomplish and if so can you show me how to implement it please? any suggestions/help is appreciated


Link Youtube Channel In Wordpress Site

I am trying to develop a site where people can find and view videos of my activities from my youtube channel. I am quite new to wordpress but I decided to use it to achieve this purpose. I have been looking for a wordpress plugin to use to display all the videos from my youtube channel but I have not found any. I used these plugins Youtube Channel Gallery and YouTube Upload Widget, but none of them work the way I want, they are only able to import one video at a time only when you input the video url. But what I want is to for my video library on my site to update as the videos in my youtube channel updates. I would appreciate all answers thanks.


How do I override a sidebar that is registered in a parent theme when using a child theme?

I currently am using a child theme, and its parent theme has registered sidebars already.. My. problem is that i want to change the parent theme's dynamic sidebar From:               register_sidebar(array(         'name' => 'Footer',         'before_widget' => '
',         'after_widget' => '
',         'before_title' => '
',         'after_title' => '

',     ));      To:               register_sidebar(array(         'name' => 'Footer',         'before_widget' => '
',         'after_widget' => '
',         'before_title' => '
',         'after_title' => '

',     ));      Now, how am I supposed to do that? I have found this hook called after_setup_theme from here but I'm a bit confused on how to do it. Should I deregister the sidebar then register it again? * * * **UPDATE:** Here is my attempt but it didn't work:               add_action( 'after_setup_theme', 'parent_override' );     function parent_override() {         unregister_sidebar('Footer');            register_sidebar(array(             'name' => 'Footer',             'before_widget' => '
',             'after_widget' => '
',             'before_title' => '
',             'after_title' => '

',         ));      }


categories and sub-categories of posts are wrongly saved in DB

I have a `jobs` category and under it I've created some sub-categories: ![enter image description here](http://i.stack.imgur.com/z7M4x.png) Now, when I create a post, sometimes, as seen below, the sub-category name comes before, and sometime after the category itself, no matter what I do and how i initially save the post, i can't make it so the the subcategory will always come before the category... This is just killing me... ![enter image description here](http://i.stack.imgur.com/4k5GJ.png)


Co-Authors Plus- Only 1 author showing with Academica theme

I installed the Co-Authors Plus plugin and while I can add multiple authors while editing, only a single author appears on the actual post. Any solutions?


How to add a forward slash to the end of wordpress home?

I have a wordpress site - domain.com/tickets domain.com redirects to another site - this will be fixed soon but will redirect for a few more months. So when I go into WP settings I put in domain.com/tickets/ for my site but it drops the last forward slash every time. The "breaks" the site during logout, login, registration because domain.com/tickets gets redirected because it isn't one full level up. The server is IIS 7.5 W2008 R2.


How can I access specific posts brought back by query_posts?

Specifically, I am bringing back the 7 most recent posts in Category A, but then I want to put the first posts thumbnail in `<div id=A>` and the second post's thumbnail in `<div id=B>` and so on for the seven posts. If this was an array, I would simply use the array position inside of the `<div>`, but I'm not sure how to access the individual posts once I have brought them back with query_posts. Any ideas?


Admin Panel errors because of functions.php

I'm creating a new theme in WP and I started noticing some errors in the Admin Panel. For example, when I want to update a page adding new content (or a blog post), it redirects to wp-admin/post.php but the page is blank, and my page/post is not updated (it happens with every page/post). I changed the theme to the default (Twenty Twelve) and all worked perfectly fine, so I realize it was related with the theme I was creating, not WP. I started erasing files to find out which had the error. When I erased functions.php, the pages/posts updated fine, so it is this file. So, I erased parts of the content, and finally all the content to find out where was the error, but even when I erased all the content, I couldn't still update the pages/posts. It only works when I erase completely the functions.php file. Although it only works with all the file erased, I'll copy the content of the file:               <?php          // Load the Theme CSS     function theme_styles() {         wp_enqueue_style('normalize', get_template_directory_uri() . '/css/normalize.css');         wp_enqueue_style('grid', get_template_directory_uri() . '/css/grid.css');         wp_enqueue_style('googlefonts', 'http://fonts.googleapis.com/css?family=Amatic+SC');         wp_enqueue_style('main', get_template_directory_uri() . '/style.css');         wp_enqueue_style('fonts', get_template_directory_uri() . '/css/fonts/fonts.css');     }               // Load the Theme JS     function theme_js() {         wp_enqueue_script('theme_js', get_template_directory_uri() . '/js/theme.js', array('jquery'), '', true);     }          add_action('wp_enqueue_scripts', 'theme_js');     add_action('wp_enqueue_scripts', 'theme_styles');               // Enable custom menus     add_theme_support('menus');          ?>      Can someone help me, please?


Check before publishing, if already exist post with custom field value

I want to use custom field value unique post to post. like Email / student ID / Driving Licence as value of custom field. It has to be unique like Post ID. When I am publishing same value in custom field I want to get message "this post is already exist". I found some Q/A, like:   * **Check before Publishing if already exist post with Current Custom Field value** - WPSE But the code given there also not working.


Problem with showing featured image

I am using the code below for showing featured image in single post content.It's working fine.But when I call the_excerpt(); in any template it showing featured image with post content.I want it show featured image only single post.Please help!               add_filter( 'the_content', 'put_thumbnail_in_posting' );      function put_thumbnail_in_posting($content) {          global $post;          if ( has_post_thumbnail() && ( $post->post_type == 'post' ) ) {             the_post_thumbnail( '',                 array(                     'style' => 'padding: 6px;                     margin-bottom: 8px;                     margin-right: 8px;                     max-width: 100%;                     border: 1px solid rgb(204, 204, 204);                     background: none repeat scroll 0% 0% rgb(238, 238, 238);'                 )             );         }              return $content;     }


Custom attachment field dissapearing

I'm adding a custom attachment field to the media uploader using WordPress' "attachment_fields_to_edit" and "attachment_fields_to_save" filters, which works fine initially after uploading an image (within the modal uploader window). Selecting an option correctly triggers an ajax request and calls my filter function to save meta data for the attachment. screenshot - shows up here However, after selecting a value for that field, and then click away to another image in the library and come back to that image, the field is no longer there. screenshot - where'd it go? I'm guessing this has something to do with how WordPress' new backbone-based media JS loads the view for each attachment, but it seems wrong. From what I've been able to find online (which isn't much) the 3.5 media manager is supposed to be compatible with the filters I'm using. Is there a different filter I should be using, or multiple filters, or is this a bug that I need to post on trac?


Where are plugins located

I typically download and install plugins via FTP, but I have installed a few from the web interface. I am trying to move WP from remote to local and I am getting a blank wp-admin screen. I think its one of my plugins causing the problem. I have renamed wp-content/plugins to wp-content/_plugins to disable all the plugins in that folder. But I have plugins installed that do not appear in the plugins folder which I believe are causing this blank wp-admin screen. Please advise. Thanks


Get the final destination after WP_Http redirects (WordPress)

I'm doing some requests to an API via WordPress, and the API uses SSL connections if they're turned on in the API settings. I'd like to determine whether SSL is turned on or off without having to ask the user if SSL is turned on on their account, and the API does a good job at redirecting, meaning   * If I access http://api/endpoint and SSL is turned on, I'm redirected to https://api/endpoint   * If I access https://api/endpoint and SSL is turned off, I'm redirected to http://api/endpoint Now what I'd like to do is see whether a redirect happened or not and record that to my options so that the other requests are fired to the correct URL without any redirections. So my question is: is there a way to determine the final destination after firing a `WP_Http->request()` when the request is being redirected? I can't see any info about that in the response arrays, I only get to see the final response but I have no idea what URL that came from. What I can do is set the `redirection` parameter to 0 and catch the max redirects allowed error, but that's not bullet-proof, since I still don't know whether the redirect happened from http to https or simply another page under http. I hope this all makes sense, let me know if you have any ideas. Thanks! ~ K


How to insert more than one row of data into a table at one time

I would like to populate a custom table, with more than one row of data at one time. If I delete the second array, it will insert one row of data. It won't add both rows at the same time though. How do I insert both rows at the same time? My code:               function mp_install_name_data() {         global $wpdb;         $table_name = $wpdb->prefix . "names";              $wpdb->insert(             $table_name,             array(                 'id' => '1',                 'name' => 'matt',                 'age' => '20',                 'point_one' => '0.45',                 'point_two' => '0.22'                  ),                   array(                 'id' => '2',                 'name' =>'james',                 'age' => '6',                 'point_one' => '0.27',                 'point_two' => '0.17'               )         );                     }


Do you use links?

DO you use links in your wordpress and why? Isn't it much easier to use you browser's bookmarks? I don't get the idea of having links at all! Please enlight me!


Upload an image in wordpress plugin

I want to upload an image in my plugin. How can i upload this. Can i use move_uploaded_file in wordpress or wordpress have any inbuild method to upload image. Please help me.


Button in SideBarOther widget not showing up on all pages

An item in SideBarOther shows up on the main article listing page, but when I select an article (same page layout, the article replaces the listing), the item isn't there. There are two items in SideBarOther, and only the 2nd one has this problem (see code below). If I remove the first one, it is correctly gone from from both the listing page and article page, and the 2nd one still only shows up on the listing page. I'm using an unmodified "News Magazine Theme 640" theme.                         <fb:like      href="http://www.facebook.com/pages/[our name]/[our number]" layout="box_count"      show_faces="false" width="50"></fb:like>      NO, I am not confusing which item is not appearing - the local directory reference ../pics on the first item works on all pages. The Facebook Like button is the one that isn't appearing on all pages. This is not hosted by Wordpress, rather Wordpress v. 2.92 is installed on our website. (I tried the official wordpress forum, and got no reply.) Thanks UPDATE   I "viewed page source" in Firefox, and THE CODE IS THERE on the article page, and it's IDENTICAL to the listing page. So why isn't it displayed??? I tried the Opera browser, same results. I added another copy of the first widget, and two of them appear on the listing page, and on the article page - the box automatically adjusted to accommodate them.


Network-Wide Plugin Settings Management

I'm using Wordpress 3.1.2, and have three blogs in a wordpress network. I would like to change some settings for a specific plugin, but have the changes applied to all the blogs on the network. I can't change plugin settings on the "Network Admin", and instead have to do it on the "Site Admin" page for each individual blog. I'm looking for the ability to change settings "sitewide" as is done, for example, by this outdated plugin.


How to disable accessing the custom post types from frontend via a link?

I am registering a custom post type like:               /* POST TYPE: SECRET CARDS */     function register_post_type_secret_cards()         {             $args = array(                 'labels' => array(                     'name' => 'Secret Cards',                     'singular_name' => 'Secret Card',                     'add_new' => 'Add New Item',                     'add_new_item' => 'Add New Item',                     'edit_item' => 'Edit Item',                     'new_item' => 'Add New Item',                     'view_item' => 'View Items',                     'search_items' => 'Search Items',                     'not_found' => 'No Item Found',                     'not_found_in_trash' => 'No Items Found in Trash'                 ),                 'query_var' => 'secret_cards',                 'rewrite' => array(                     'slug' => 'secret-cards/',                 ),                 'public' => true,                 'menu_position' => 4,                 'supports' => array(                     'title',                 )             );                  register_post_type('secret_cards', $args);              }     add_action( 'init', 'register_post_type_secret_cards' );      And these cards are accessible from frontend like:               http://myweb.com/secret-cards/john-wayne      But I want to not allow people to access these iks from frontend. It should be accessible only in admin. How to do that?


WordPress Term for Custom List

Would you mind helping me out. I am experienced in programming yet really new to wordpress. I was task to handle this. I just need to know what are these called (The ones with the pin icon): Image is here (I can't seem to post images here without 10+ reputation, sorry) In SharePoint this could have been Custom list, im just not sure what it is called in wordpress. I need to know its name to search for it. Also, how can I add a new "list", export and import contents in built. Thank you so much for the help


How to let crawlers search paginated comments?

With comment pagination, Google doesn't index the older pages and comments become essentially lost to searches. Is there a way to let search engines crawl paginated comments, perhaps by generating a sitemap file that includes all paginated comments?


How to consolidate all sitemaps in a multisite network?

I have a multisite installation with quite a lot sites on subdomains. The problem is that all multisite sitemap plugins create a separate sitemap for each site. I do not want to have to add dozens of sites to Webmasters Tools. This is a lot of work, makes it all hard to manage, and forces me to read all the stats and reports separately, when I want to have only one. How can I create a single sitemap that encompasses every site in the network?


How do i Sort my Posts

I search for a solution how i can sort the article in my page. I searched for hours in google and try severla things but nothing works :( . Anyway, maybe anybody has a good tip for me. I want a simple list with options for sorting like "newest first" or "relevance" or "alphabetically (Entry Title)". Any Ideas?


Custom metaboxes not saving after switching themes

I recently switched themes and copied over my metaboxes from the old functions.php into the new one. They show up but when I click publish/edit they dont save               add_action( 'add_meta_boxes', 'cd_meta_box_add' );          function cd_meta_box_add() {         add_meta_box( 'my-meta-box-id', 'Video', 'omc_video_encode', 'post', 'normal', 'high' );         add_meta_box( 'my-meta-box-id-a', 'Audio', 'omc_audio_encode', 'post', 'normal', 'high' );         add_meta_box( 'my-meta-box-id-d', 'Download', 'download_link', 'post', 'normal', 'high' );     }          function omc_video_encode() {         ?>           Iframe here.           <input style="width: 500px;" type="text" name="omc_video_encode" id="omc_video_encode" />           <?php     }          function omc_audio_encode() {         ?>           Jwplayer here.           <input style="width: 500px;" type="text" name="omc_audio_encode" id="omc_audio_encode" />           <?php     }          function download_link() {         ?>           Link here.           <input style="width: 500px;" type="text" name="download_link" id="download_link" />           <?php     }          add_action( 'save_post', 'cd_meta_box_save' );          function cd_meta_box_save( $post_id ) {         // Bail if we're doing an auto save           if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )             return;         // if our nonce isn't there, or we can't verify it, bail          if ( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'my_meta_box_nonce' ) )             return;         // if our current user can't edit this post, bail           if ( !current_user_can( 'edit_post' ) )             return;     }


Search form options group categories

Hello i use this code to allow my readers to filter the search results by targeting a specific category. How can edit it to make 2 options of categories groups? I have 20 categories. I want the first option to filter 10 specific categories and the other option to filter the other 10.               <form role="search" method="get" id="searchform" action="<?php bloginfo('siteurl'); ?>">       <div>         <label class="screen-reader-text" for="s">Search for:</label>         <input type="text" value="" name="s" id="s" />         in <?php wp_dropdown_categories( 'show_option_all=All Categories' ); ?>         <input type="submit" id="searchsubmit" value="Search" />       </div>     </form>      Thank you.


Reordering fields in registration form via custom plugin

I'd like to reorder the fields in the default WP registration form. I'm adding additional fields with my plugin but they are appearing below the username and email fields. My code is below (it's essentially copied and modified from here). Does anyone know how I can do that? I assume it involves adding a parameter to the action `register_form`, but I can't find anything in the codex about it. Also, if you have any advice on how I could improve validation as well (if necessary), it would be appreciated as well as I'm trying to learn how to build plugins properly.               // Set variables     $theme_name = 'ibm';          /* ****************************************************************** */                         /* !ADD FORM ELEMENTS */     /* ****************************************************************** */           function osu_register_form() {         // Get and set any values already sent         $first_name = ( isset( $_POST['first_name'] ) ) ? $_POST['first_name']: '';         $last_name = ( isset( $_POST['last_name'] ) ) ? $_POST['last_name']: ''; ?>
             <?php _e('First Name', $theme_name) ?>
             <input type="text" name="first_name" id="first_name" class="input" value="<?php echo esc_attr(stripslashes($first_name)); ?>" size="25" />

             <?php _e('Last Name', $theme_name) ?>
             <input type="text" name="last_name" id="last_name" class="input" value="<?php echo esc_attr(stripslashes($last_name)); ?>" size="25" />
     <?php }          /* ****************************************************************** */                             /* !VALIDATION */     /* ****************************************************************** */           function osu_registration_errors($errors, $sanitized_user_login, $user_email) {         if ( empty( $_POST['first_name'] ) ) {             $errors->add( 'first_name_error', __('ERROR: You must include a first name.', $theme_name) );         }         if ( empty( $_POST['last_name'] ) ) {             $errors->add( 'last_name_error', __('ERROR: You must include a last name.', $theme_name) );         }         return $errors;     }               /* ****************************************************************** */                         /* !SAVE USER META DATA */     /* ****************************************************************** */           function osu_user_register($user_id) {         if ( isset( $_POST['first_name'] ) ) {             update_user_meta($user_id, 'first_name', $_POST['first_name']);         }         if ( isset( $_POST['last_name'] ) ) {             update_user_meta($user_id, 'last_name', $_POST['last_name']);         }     }               // Add functions to WP actions and filters     add_action('register_form','osu_register_form');     add_filter('registration_errors', 'osu_registration_errors', 10, 3);     add_action('user_register', 'osu_user_register');


Use theme folder instead of plugins_url

I imagine this is really simple but I can't work it out. I am trying to add a menu page to the WordPress dashboard through my theme. I have the following...               add_menu_page(          'Test',          'Test',          'manage_options',          'myplugin/myplugin-admin.php',          '',          plugins_url( 'myplugin/image/icon.png' ),          6      );      Which works, but I want to use an icon in my themes directory instead of plugin. How can I alter this to look in there instead? I have tried using `theme_url` instead but it's not working.


How to hide "post" link from the admin bar

After studying several blogs, I figured out that to add/edit/delete admin bar items need to do something like this:               add_action( 'wp_before_admin_bar_render', 'wpse20131211_admin_bar' );          function wpse20131211_admin_bar() {        global $wp_admin_bar;        $wp_admin_bar->remove_menu('wp-logo');        $wp_admin_bar->remove_menu('comments');     }      But with this I can remove comments links, wp logo etc. But can't remove the **Post** link under the **+ New** menu on the admin bar.   ![post link under admin bar](http://i.stack.imgur.com/qht6c.png) I tried with:               $wp_admin_bar->remove_menu('post');      and similarly with `'posts'`, `'add-post'` etc. But failed.


Plugin development: can't update settings with multiple settings sections

I've got my plugin options set up to be in multiple sections, for ease of use and more efficient database calls. However, since reorganizing my Options page I can only seem so save changes made in the last section. No changes I make to earlier sections take effect. The code for the admin options page is here: https://github.com/cconover/wp- author-customization/blob/master/author-customization/admin/author- customization-admin.php Here's a screenshot of the Options page: ![enter image description here](http://i.stack.imgur.com/XCcs9.png) I'm sure the answer is staring me in the face, but I need some help looking in the right place.


Custom POST parameters, index.php

I have contact form and I need to write custom function, that will send some data to admin e-mail. I dont get how to make index.php (or other wordpress script) receive my POST parameters, which I will handle.


Get the post_type of current taxonomy or category page

I want to get post type of currently visited category or term. As for example, I have post_type **post** and category named **Blog**. On Blog listing page, how can I get that this is a category of the `post_type` **Post**?


have_comments() does not work

I have set a comment() condition in wordpress. This condition is set in comments.php just as the wordpress default theme does. then the whole comments.php file is loaded using comment_template; Now, when I remove have_comments() condition, everything works and all the comments are loaded, but when I add this condition, it returns false as if there are no comments. Here is my whole comments.php file:               <?php     /**     | This page deals with the comment-system and template in the Behdis Marketing Group Wordpress Theme.        **/     $commenter = wp_get_current_commenter();     $req = get_option( 'require_name_email' );     $aria_req = ( $req ? " aria-required='true'" : '' );     $fields =  array(         'author' => "
<input type='text' name='author' placeholder='Full Name' />
",         'email'  => "
<input type='text' name='email' placeholder='Email />
",      );          $comments_args = array(         'fields' =>  $fields,         'comment_field' => "
<textarea name=\"comment\" id=\"comment\" ></textarea>
",         'comment_notes_after' => '',         'title_reply' => 'Write your comment...',         'title_reply_to' => 'Reply',         'label_submit' => 'Comment!',         'comment_notes_before' => "
" . 'Your email is kept secret forever' . ' '     );          comment_form($comments_args);     ?>     <?php              if( have_comments() )         {            ?>
              <?php             $comments = get_comments();             foreach($comments as $comm)             {                 ?>

                 <?php echo $comm->comment_author;?> در تاریخ <?php comment_time();?>
                 <?php echo $comm->comment_content;   ?>
                 <?php             }             ?>
         <?php         }// end of have_comments()        else         {             ?>
                 No comments, be the first visitor to comment on this post!
             <?php            }         ?>


.htaccess not working in Wordpress

I'm trying to make use of the post name permalink so that visitors can access the page created by the plugin that I'm using. I've already checked `phpinfo()` and mod_rewrite is listed under the loaded modules section. I also copied the `.htaccess` string given by wordpress and I added it on the `.htaccess` file in the web root directory (which is alongside the `wp-content` directory because I moved the wordpress files outside the wordpress directory). The `.htaccess` file contains the following:               <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /devuser/     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /devuser/index.php [L]     </IfModule>      Any idea what's wrong or where should I be looking?


Add title="" to A PHP Code

I am using a code to call WP thumbnails and want to add a title="" tag. I would like the title to call the_title... how do I do so? I want to assign the title tribute to the image, not the link. My code:               <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'thmb-archive' ); } ?>


Wordpress bool(false) means taxonomy compare not working

I have a loop pulling in a wordpress content page 'peopleformat'. Here is that loop               <?php                          // Start the Loop.                     while ( have_posts() ) : the_post();                     $do_not_duplicate[] = $post->ID;                              /*                          * Include the post format-specific template for the content. If you want to                          * use this in a child theme, then include a file called called content-___.php                          * (where ___ is the post format) and that will be used instead.                          */                     get_template_part( 'content', 'peopleformat' );                          ?>                          <!--Get all the rest of the posts to display  -->                     <?php endwhile; ?>                     <?php                     // 2nd loop                      $args = array( 'post_type' => 'profile', 'posts_per_page' => 300, 'order' => 'DESC' );                 $loop = new WP_Query( $args );                 while ( $loop->have_posts() ) : $loop->the_post();                 if (in_array($post->ID, $do_not_duplicate)) continue;                          ?>      Within the people format page I am comparing two variables. If they are the same then ' do something'               <?php                  $acf_tax = get_field('key_person');                 $custom_tax = get_taxonomy( $Team );                 if($acf_tax === $custom_tax) :             ?>      However after doing a var_dump( $acf_tax, $custom_tax ), it comes up with bool(false) bool(false) . And im not sure how to stop from being a bool? And finding the values properly? The end goal i would like to achieve is if acf_tax and custom_tax have the same value then it will 'do something'.


Updating post meta and Meta Box plugin

I've installed Meta Box wordpress plugin and create a `text` field meta box with `clone` option:               add_action( 'admin_init', 'rw_register_meta_boxes' );     function rw_register_meta_boxes()     {         $meta_boxes = array();         $meta_boxes[] = array(                 'id'    => 'vip',                 'title'    => 'VIP Links',                 'pages'    => array( 'post'),                 'fields' => array(                     array(                         'name'  => 'Download links',                         'id'    => "vip",                         'desc'  => 'Type here',                         'type'  => 'text',                         'std'   => '',                         'size' => 100,                         'clone' => true,                     ),                 ),                 'validation' => array(                     'rules' => array(                         "vip" => array(                             'required'  => false,                         ),                     )                 )             );         foreach ( $meta_boxes as $meta_box )         {             new RW_Meta_Box( $meta_box );         }     }      it works and meta box is added. But the problem is that, I need to do some works on values while post publishing and then update the meta box values:               $VIP = get_post_meta($pid, 'vip', false);     /*         do some operations here      */     update_post_meta($pid, 'vip', $NEW_VIP);      This snippet is **within a function** that's called on post publish: `add_action('publish_post', 'function_name');` But It won't update! I tried to see if function runs and which values `$NEW_VIP` contains. So I added a line before `update_post_meta()` function to assure myself:               print_r($NEW_VIP); die();      Output is as expected and `$NEW_VIP` has correct values (is an array) but `update_post_meta` doesn't save it and meta box value(s) will always remain unchangeable. Any help would really be appreciated. **Update #1** Full Function:               function dl_url($pid)     {         global $wpdb;         $VIP = array_filter(get_post_meta($pid, 'vip', false));         //$urls = array();         //print_r($VIP); die();         if(!wp_is_post_revision($pid) && $VIP[0])         {             foreach ($VIP[0] as $mid => $link)             {                 if(preg_match("/^((https?:\/\/)|(www\.))([a-z0-9-].?)+(:[0-9]+)?(\/.*)?$/i", $link))                 {                     $rand = rand(1000,99999999);                     $hash = strrev(md5($link.$rand));                     $file = pathinfo($link);                     $filename = $file['basename'];                     $size = get_size($link);                     $price = get_post_meta($pid, 'price', true);                     if(!$price)                         $price = 0;                     if($row = $wpdb->get_row("SELECT * FROM wp_dlurl WHERE pid = '{$pid}' AND hash = '{$hash}'",ARRAY_A)) // check if existed in db                     {                         // if existed update url                         $arr = array('price' => $price);                         $format = array(0 => '%d');                         $home = str_replace(array("/",":"),array("\/","\:"),get_bloginfo('url'));                         if(!preg_match("/".$home."\/\?download\=\w{32}/", $link))                         {                             $arr += array('url' => $link, 'filename' => $filename, 'size' => $size, 'hash' => $hash);                             $format += array(1 => '%s', 2 => '%s', 3 => '%d', 4 => '%s');                             $urls[] = get_bloginfo('url')."/?download=".$hash;                             //update_post_meta($pid, 'vip', get_bloginfo('url')."/?download=".$hash);                         }                         $wpdb->update(REV_DL, $arr, array('pid' => $pid, 'hash' => $row['hash']), $format, array('%d','%s'));                     }                     else                     {                         // if not existed insert                         $wpdb->insert(REV_DL, array('pid' => $pid, 'price' => $price, 'url' => $link, 'filename' => $filename, 'size' => $size, 'hash' => $hash), array('%d','%d','%s','%s','%d','%s'));                         $urls[] =  get_bloginfo('url')."/?download=".$hash;                         //print_r($urls);                         //die();                     }                 }             }             if(isset($urls))             {                 //print_r($urls);                 //die();                 $VIP = $urls;             }             //print_r($VIP); die();             update_post_meta($pid, 'vip', $VIP);             //print_r(get_post_meta($pid, "vip", true));             //die();              }     }     add_action('publish_post', 'dl_url', 99);


WP Posts Not Adding Up

My WP is hosted at Yahoo I am running WP 3.5.2 and the Posts Page does not add up All (4,356) | Published (629) | Sticky (1) | Drafts (265) | Private (88) WP seems to have an extra 3373 posts. I don't have a Trash option above, so I am guessing these are in the trash. I have not been able to get a good backup to update. I would like to get rid of the mysterious additional 3373 posts so I can get a BU to upgrade. I pinged Yahoo and they are useless, other seraches on the innertubes point to database tables that need to be pruned but I'm being a wimp on editing the databases. Are there any other options? Thanks rb-


author.php shows profiles of all users not authors only

I've got an issue with author's template. It works great and displays authors profiles as expected, but the issue is that you can see non-authors profiles also (contributors / subscribers, basically all registered users, including and admin) simply by substituting username in URL (www.mysite.com/author/subscribername). Is there any simple way to fix it and show 'authors' profiles only and return 'page not found' for others? In advance of your support, thank you. **Update:** Solution I've applied and will use (unless someone will advise how to amend the initial query). This returns proper 'page not found' page, including 'page not found' page title:               function tb_author_role_template( $templates='' )     {         global $wp_query;              $author = get_queried_object();         $role = $author->roles[0];              if($role == 'author')          {             $templates=locate_template(array("author.php",$templates),false);         } else { // error if not author             header( 'HTTP/1.0 404 Not Found' );             $templates = locate_template(array("404.php",$templates),false);             $wp_query->is_404 = true;         }         return $templates;     }     add_filter( 'author_template', 'tb_author_role_template' );


How to find installed plugins

I been searching long of any way to find the list of the plugins installed in a WordPress site. Though I got a way, the "http-wp-plugins.nse" brute force script but I don't know how to use this script. If any body know any way please share.


query specific posts according their custom fields, using sql SELECT

My posts have a bunch of custom fields, to help insert and display custom info easily. I am trying to build a search that would select and display posts according values of specific 2 custom fields. The first field "type" is a radio button in my wp-admin, so in database its meta value is always one word. But second field is checkboxes, so in database meta value has several words, and I need to get posts that have the one visitor selects. What I have so far:   1. Search form, that consists of 2 dropdowns, each for one custom field. I use it one homepage: pastebin.com/zxPuGduW   2. A function in functions.php, to select posts according the values set in dropdowns: pastebin.com/Z6D0GM4q   3. A results page to show the posts according selections in the dropdowns form: pastebin.com/KHK0exWn