Image not displayed

I am using the following inside images-options which is linked to functions.php.When clicked on submit button it crashes in wordpress admin               Image 1:	           <input type="text" name="director_image1" value="<?php print get_option('director_image1'); ?>" />

      I am using this to get the image in header.php.               var theImage=<?php $image = get_option('director_image1');?>     <?php if( $image) : ?>     <?php echo "'".$image."';"; ?>     <?php endif; ?>      And finally i am using theImage variable inside a javascript file :               {      src: theImage      fade: 3000      }      Could you please help me out the image is not being displayed. The console gives me this error: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/wp- content/themes/GapInvite/images-options.php:2) in /Applications/MAMP/htdocs/wp-includes/pluggable.php on line 896


how to get extra info from checkout in wp-ecommerce

In wp-ecomemrce I have added a new field in the checkout to capture the company name. I need to get the data from the transaction but how? I am not sure how the form fields are stored to be able to retrieve them.


Custom field bug in Wordpress 3.2

I have a question. I just installed Wordpress 3.2. And ever since then, when I want to add a custom field, precisely when I clicked on "Add custom field", my page is refreshed. And no custom field is added. What is it ? Ajax bug ? Wordpress 3.2 ? Can you help me please ?


Why am I unable to login after converting to www?

So I originally designed the site without the www. I've since realized that it's going to cause more problems than necessary. I created a rewrite rule that converts to www. I then changed the domain in wp-config               define( 'DOMAIN_CURRENT_SITE', 'openeye.net' );     define( 'PATH_CURRENT_SITE', '/' );     define( 'SITE_ID_CURRENT_SITE', 1 );     define( 'BLOG_ID_CURRENT_SITE', 1 );     define('WP_HOME','http://www.openeye.net');     define('WP_SITEURL','http://www.openeye.net');     define('WP_MEMORY_LIMIT', '96M');      I'm now not able to edit pages or access wp-admin. What would cause that?


Taxonomy-{taxnonomy}.php is not working

I have just created a custom post type (portfolio) for a wordpress website. I also have added a Custom Taxonomy called (portfoliocategory). I have created a archive page for my Custom Post Type (archive-portfolio) which is working properly, but I need help with Custom Taxonomy Template, I have created taxonomy-portfoliocategory.php but it is showing the default archive page and not showing the taxonomy page template!!


Delayed commenting

We have a client who is using WP as part of an alternate reality game, and as part of it, they want to have 'characters' leave comments on posts at certain times. They basically want to be able to queue up comments in advance, so that they drop at the right time (similar to how you can control posts going live at a certain time.) Is there a plugin that handles this?


What is the advantage of using header-catname.php over is_category('catname');?

Let's say I have a category named as `catname` (the slug would be `catname`). I want the header styled differently when visitors open the category catname. The article on Ghacks explains how to create a custom header (styled differently) when visitors open the category catname, achieved by creating header-catname.php and including it in category-catname.php with `include(TEMPLATEPATH.'/header-catname.php');` (instead of the usual `get_header();` ). You can read the short article itself if my explanations is difficult to follow (I apologize for my lack of proficient English). My question is: what is the advantage of using above method, over using `is_category ('catname')` in header.php to create custom header only for the catname category? I mean, in the header.php we could just use this without creating additional header-catname.php:                <?php if ( is_category('catname') ) { ?>           /* Insert custom header for category catname here */           <?php } else { ?>           /* Insert the usual header here */           <?php } ?>      Does using the conditional IF make the page load slower? Or is there any disadvantage?


Does it make sense to assign functions like is_paged() to a variable rather than using it multiple times?

Actually a simple question, but I need to be sure that assigning a variable for the result of a function can help to increase the speed of a site e.g. The function: `if is_paged(){ $paged = 1; }` The replacement: ` if $paged == "1" .. then do ` \- RATHER THAN USING THE SAME FUNCTION over and over W3 total cache would most likely cache it, but sometimes users hit pages that are not cached and I think it could increase the speed of a website, **is my assumption correct?**


Change Login CSS - Include instead of echo

I'm trying to figure out how to include a stylesheet instead of echo'ing `<style>` tags. I'm currently using the following function:               // Custom Login Styles     function login_styles() {         echo '<style type="text/css">             h1 a {                 background: url('.get_template_directory_uri().'/etc/images/logo_login.png) center center no-repeat !important;                 display: block !important;                 height: 50px !important;                 margin: 0 auto 10px !important;                 position: relative;                 width: 131px !important;             }             .login #nav a, .login #backtoblog a {                 color: #FFF !important;                 text-shadow:none;                 text-decoration: none;             }             .login #nav a:hover, .login #backtoblog a:hover {                 color: #000 !important;                 text-shadow:none;                 text-decoration: none;             }             .login #backtoblog a {                 display:none;             }             body.login {                 background-color: #2F2F2F;             }             .login form {                 background-color: rgba(255, 255, 255, 0.6) !important;                 border-radius: 0 !important;             }             .login .message {                 border-radius: 0 !important;                 background: linear-gradient(to bottom, #7007B6 0%, #805B98 100%) repeat scroll 0 0 #16B4F1 !important;                 border-color: #7007B6 !important;                 color:#FFF !important;                 box-shadow:0 1px 0 rgba(120, 200, 230, 0.5) inset;             }             .login form .input, .login input[type="text"] {                 border-radius:0px !important;             }             .login h1 a {                 background-size: auto !important;             }             .login label {                 color: #2F2F2F;                 font-size: 14px;             }             .wp-core-ui .button-primary {                 border-radius: 0px !important;                 border-color: #7007B6 !important;                 box-shadow: 0 1px 0 rgb(127, 84, 155) inset;                 background: #805B98 !important; /* Old browsers */                 background-image: -moz-linear-gradient(top,  #805B98 0%, #7007B6 100%) !important; /* FF3.6+ */                 background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#805B98), color-stop(100%,#7007B6)) !important; /* Chrome,Safari4+ */                 background-image: -webkit-linear-gradient(top,  #805B98 0%,#7007B6 100%) !important; /* Chrome10+,Safari5.1+ */                 background-image: -o-linear-gradient(top,  #805B98 0%,#7007B6 100%) !important; /* Opera 11.10+ */                 background-image: -ms-linear-gradient(top,  #805B98 0%,#7007B6 100%) !important; /* IE10+ */                 background-image: linear-gradient(to bottom,  #805B98 0%,#7007B6 100%) !important; /* W3C */             }             .wp-core-ui .button-primary:hover {                 box-shadow: 0 1px 0 rgb(127, 84, 155) inset;                 background: #7007B6 !important; /* Old browsers */                 background-image: -moz-linear-gradient(top,  #7007B6 0%, #805B98 100%) !important; /* FF3.6+ */                 background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#7007B6), color-stop(100%,#805B98)) !important; /* Chrome,Safari4+ */                 background-image: -webkit-linear-gradient(top,  #7007B6 0%,#805B98 100%) !important; /* Chrome10+,Safari5.1+ */                 background-image: -o-linear-gradient(top,  #7007B6 0%,#805B98 100%) !important; /* Opera 11.10+ */                 background-image: -ms-linear-gradient(top,  #7007B6 0%,#805B98 100%) !important; /* IE10+ */                 background-image: linear-gradient(to bottom,  #7007B6 0%,#805B98 100%) !important; /* W3C */             }             input[type="checkbox"] {                 margin: -1px 0 0 0 !important;             }         </style>';     }          add_action('login_head', 'login_styles');      Any help is greatly appreciated..


Should I use Pre Get Posts or WP_Query

I have the following query which I call in my taxonomy.php template via `query_brands_geo('dealers', 'publish', '1', $taxtype, $geo, $brands);` This function works perfectly. However after reading codex for query posts it mentioned pre_get_posts as a preferred way to alter the default query. Would the pre_get_posts be more efficient then my wp_query function below? If so how would I construct the pre_get_posts and pass my variable and query below?               function my_custom_query($posttype, $poststatus, $paidvalue, $taxtype, $geo, $brands) {        global $wp_query;         $wp_query = new WP_Query();        $args = array(            'post_type' => $posttype,            'post_status' => array($poststatus),            'orderby' => 'rand',            'posts_per_page' => 30,            'meta_query' => array(               array(                  'key' => 'wpcf-paid',                  'value' => array($paidvalue),                  'compare' => 'IN',                  )            ),            'tax_query' => array(               'relation' => 'AND',               array(                  'taxonomy' => $taxtype,                  'field' => 'slug',                  'terms' => $geo               ),               array(                  'taxonomy' => 'brands',                  'field' => 'slug',                  'terms' => $brands               )            )         );              return $wp_query->query($args);      }


current post with current author

how can i check if the current post belongs to the current author? this is my basic code; `               if($curpost) {                     wpuf_edit_show_form($curpost);                 } else {                     $error = "there is no post.";                 }      ` also how can i add the same control to these action; `               function wpuf_user_dashboard_post_list() {         global $wpdb, $userdata;              get_currentuserinfo(); // grabs the user info and puts into vars              //delete post         if ($_REQUEST['action'] == "del")         {             check_admin_referer('wpuf_del');             wp_delete_post($_REQUEST['pid']);             echo '
deleted.
';         }              //get the posts         $sql = "SELECT ID, post_title, post_name, post_status, post_date "                 . "FROM $wpdb->posts "                 . "WHERE post_author = $userdata->ID AND post_type = 'post' "                 . "AND (post_status = 'publish' OR post_status = 'pending' OR post_status = 'draft') ";              $posts = $wpdb->get_results($sql);         $count = 1;         //d($posts);      ` thanks.


Automatically pull newer posts and append to current page.

I have a page that currently loads posts of custom post type using regular WP_Query. The custom post type are for news articles. Newer news articles (posts) are constantly written, as such there is a need for loading newer posts without having the user to refresh the page. The effect I am desiring is similar to what one can find on Facebook or Twitter. Whenever there is a new post or tweet on these sites, the newer post is automatically added to the top of the posts already displayed. Any code snippets or ideas on how to get this done? Regards, John


How do I insert an already uploaded video file into my Media Library?

I'm having problems with the WP uploader (hosting issue); WP is pooping out after uploading files that are relatively large (> 32MB). **My idea was to upload the video file via SFTP to the server and then try to get WP to insert it into the Media Library. How do I do this?** I know that it isn't as simple as just putting it into `wp- content/uploads/<date-path>/` because there is some meta-data to add to the back-end DB. I've seen some posts for `media_sideload_image` but looking at the code, it looks like this is specifically for images. I looked at `media_handle_sideload` but I'm not sure how it works or how to create a solution to insert this file where it needs to go. For example, the comments say: > @param array $file_array Array similar to a {@link $_FILES} upload array What does `{@link $_FILES} upload array` mean?


How to override pluggable function in theme?

All the documentation I've encountered discusses overriding pluggable function via your plugin. What if you're doing theme development instead? My functions.php requires another file that overrides the `get_user_by()` function, defined in `pluggable.php`. If I omit the `if( function_exists() )` call I get the "Cannot redeclare..." error. If I include the `if( function exists() )` call, then I get no error, but of course my function is then ignored, since the pluggable version exists. Based on Dominic's awesome post on the WordPress startup order, it's clear that `pluggable.php` is loaded _before_ your theme's `functions.php` and so forth, so that explains the error. So the question is - how can you take advantage of that nice pluggable architecture from within a theme, without resorting to writing plugins which then must be bundled or installed with the theme? **Further notes** : So it appears that the argument is that themes should not be trying to do what plugins do. But that argument is over four years old (according to the 4-digit trac number). I'd love to hear from some heavy hitters whether this philosophy still applies, given the complex topology of today's theme development landscape. I'd like to believe we've evolved since then. **Context** : I'm developing a one-off CMS solution for a customer, with a lot of custom metadata, customization of the Admin back-end, the login/authentication process, the works. And of course, there's the design component - that's where the theme part comes in. Fact is, these are simply **not** reusable components - they will never apply to another client, they will never be put under GPL and open sourced, and they are most certainly not to be distributed / installed on other WordPress deployments. At best there are some best practices I will leverage on future projects, but that will be strictly a reference / copy-paste job. This does not sound like a use case for plugins to me. The theme is installed, maybe a child theme of Twenty Eleven, maybe a standalone, its functions.php calls in a boatload of includes, each handling a different aspect of the CMS in question. Then the theme template files use custom 'template tags' that are defined in the includes. I don't want to have theme files with dependencies on some plugin or other being activated, etc. It just doesn't make sense to build complexity into the system. Sure, I can put it in the must-use plugins folder, but that still feels like a hack - right now, _everything_ that has to do with the customizations made for this project are contained in `wp- content/themes/my-theme/`. I don't also want to have to consider searching for stuff in some plugins folders as well. Don't get me wrong. I love plugins and I use them and write them. And I do use plugins in conjunction with this sort of highly customized theme development _when_ the plugin is third-party and represents best practices far beyond what I could possibly roll out in a reasonable timeframe. But when I need to modify core functionality for a one-off scenario, I turn to action hooks, filter hooks, and I'd like to be able to rely on pluggable functions for the user and authentication side of things too.


Is using taxonomies the way to go here or would custom post types be better?

I to create a site that will let subscribers select items from a list, say of books or DVDs - essentially building a collection that they could then add additional info, e.g. price paid, where purchased, etc. Then if a post is later added that is related to that item, the user would be notified. My thoughts are to use specific taxonomies for the list of items. And then figure out how I can let users check off their interest in these specific taxonomies and add the additional info. Then essentially subscribe them to posts related to only the taxonomies they are interested in. Am I off base in my thinking? Is there a better way to do what I am talking about?


wp_list_pages bug in "number" parameter

I'm trying to build a list of the first subpage out of 10 pages. So my page structure is this:   * Page A      * Page A1     * Page A2    * Page B      * Page B1    * Page C      * Page C1     * Page C2     * Page C3 And I'd like to display this list in my template:   * Page A1    * Page B1    * Page C1 I'm pretty close, but I'm stuck on a bug in WP_List_pages that causes the number parameter to not work (http://core.trac.wordpress.org/ticket/10745). This means all the subpages are always displayed, whereas I only want to display the first subpage. This is the code I'm using:                       <?php             $args=array(             'post_type'     =>'page',             'showposts'     =>10             );             $my_query = new WP_Query($args);             if( $my_query->have_posts() ) { ?>             <ul>             <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>                 <?php                  $children = wp_list_pages('title_li=&child_of='.$id.'&echo=0');                 $pieces = explode('"', $children);     <-- STUFF GOES HERE? -->                 ?>             <?php endwhile; ?>             </ul>             <?php } //if ($my_query)             wp_reset_query();  // Restore global post data stomped by the_post(). ?>      I'm thinking I'll need a for loop to only display the first post, but my php knowledge is lacking so I'm kind of stuck. Anybody in for a quick answer?


Styling an "active" link outside of Wordpress default menu

I want the background-color of the selected box on this page to display gray color once the user lands on the corresponding page. My link is currently setup inside of the page template itself as a traditional link, and is not being displayed under the default Wordpress menu setup. Do I need to add a CSS style to the "active" box, or do I need to create a PHP conditional that determines the activated page? I'm just a little confused. Here's the boxes: http://richmindonline.com/virtual/solutions/

                       <?php get_sidebar('1-products'); ?>

                      <?php get_sidebar('2-products'); ?>

                          <?php get_sidebar('3-products'); ?>

                         <?php get_sidebar('4-products'); ?>


How do I find the version of WordPress I have from the source code?

Given a copy of WordPress installation, how do I find out what version it is from the source code?


Allow user to "edit_others_posts" to save only, not publish

I want to add a couple of editors that can `edit_others_posts`, but I do not want them to be able to **publish** others posts, only **save** the post by clicking on the _Submit for Review_ button. How can I do this? EDIT: To explain this in detail. Currently, we can't allow a user to edit others post by **only** saving the post. If `edit_others_post` is enabled for the user, then they can **publish** the post. Workflow I'm aiming for:   1. Editors can only edit others pending posts (solved here).    2. Editors can save the pending post **but** not publish it. So the _Submit for Review_ button will be available for them (which is the "update post" button when a post is in pending mode)


Comment rating plugin for wordpress.

i want to know, which is this comment rating plugin ? used here http://www.smashingmagazine.com/2010/08/10/showcase-of-delicious- coffee-websites/ plz have a look at comment section


Fetching instagram api not working on wordpress

<?php     $json = file_get_contents('https://api.instagram.com/v1/users/userid/media/recent/?access_token=accesstoken');     $a_json = json_decode($json, true);     foreach( $a_json['data'] as $key => $value) {       $a_images[$value['id']]['link'] = $value['link'];       $a_images[$value['id']]['url'] = $value['images']['standard_resolution']['url'];       $a_images[$value['id']]['caption'] = $value['caption']['text'];     }               echo '
';     $i = 0;      foreach($a_images as $image)      {       if ($i < 3) {         echo '

'.$image['caption'].'

';         $i++;       }     }     echo '
';      I dont know why but this code seems to be not running on my wordpress. What issues should i be looking at? But when i compile this on some online compiler it works. Got these errors.               PHP Warning:  file_get_contents(https://api.instagram.com/v1/users/*******/media/recent/?access_token=*****count=50): failed to open stream: HTTP request failed! HTTP/1.1 500 Server Error\r\n in /var/www/vhosts/******* on line 151          PHP Warning:  Invalid argument supplied for foreach() in /var/www/vhosts/*********on line 153          PHP Warning:  Invalid argument supplied for foreach() in /var/www/vhosts/*****on line 162


Create WP_QUERY args with reference to my custom query

Sorry for my some different question. Can anyone help me to create WP_QUERY() arguments with reference to my following custom query? My query is as follows.               SELECT SQL_CALC_FOUND_ROWS  $wpdb->posts.*                          FROM  {$wpdb->posts}                           LEFT JOIN {$wpdb->term_relationships} ON({$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id)                         LEFT JOIN {$wpdb->term_taxonomy} ON({$wpdb->term_relationships}.term_taxonomy_id = {$wpdb->term_taxonomy}.term_taxonomy_id   AND {$wpdb->term_taxonomy}.taxonomy = 'project_position')                         LEFT JOIN {$wpdb->terms} ON({$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id AND {$wpdb->term_taxonomy}.taxonomy = 'project_position')                         WHERE  {$wpdb->posts}.post_type = 'projects' AND ( {$wpdb->posts}.post_status = 'publish')                           AND name IS NOT NULL                         ORDER BY CAST({$wpdb->terms}.name AS UNSIGNED ) {$options['order']} LIMIT 0,6      Thanks


Weird results using wp-query with 'date_query' for last week

I'm trying to get the most voted posts from last month, last week and last day. All seems to work right except the "top week". Here is the code:               <?php          //Date for ranking     $today = getdate();          if(is_page( 'topdia' )) {         $date_query = array(array(                                 'year'  => $today["year"],                                 'month' => $today["mon"],                                 'day'   => $today["mday"],                                 ));               $date = new DateTime();         $date = $date->format('Y-m-d H:i:s');     }     elseif(is_page( 'topsemana' )) {          $date_query = array(array(                                         'year' => date('Y'),                                         'week' => date('W'),                                     ));         $date = new DateTime('-1 week');         $date = $date->format('Y-m-d H:i:s');     }     elseif(is_page( 'topmes' )) {         $date_query = array(array(                                             'column' => 'post_date_gmt',                                             'after' => '1 month ago',                                         ));              $date = new DateTime('-1 month');         $date = $date->format('Y-m-d H:i:s');                                        }     else {         $date_query = 'any';                                                         $date = '0000-00-00 00:00:00';     }     //Seleccionar los más votados     global $wpdb;          $query = "SELECT        p.id AS id,        SUM(v.value) AS votes     FROM        {$wpdb->posts} p      INNER JOIN nsn_wti_like_post v ON v.post_id = p.id     WHERE p.post_date >= '{$date}'     GROUP BY       p.id     ORDER BY       SUM(v.value) DESC     LIMIT 5";          $myrows = $wpdb->get_results( $query );          $count = 0;     $posts_id = array();     $posts_votes = array();     foreach( $myrows as $post ) {         if($post->votes > 0) {             $posts_id[] = $post->id;             $posts_votes[] = $post->votes;         }     }          $temp = $wp_query; // assign ordinal query to temp variable for later use       $wp_query = null;     $wp_query = new WP_Query( array( 'post__in' => $posts_id, 'ignore_sticky_posts' => true, 'date_query' => $date_query, 'orderby' => 'post__in' ) );      ?>      And then, I call the loop:               if ($wp_query->have_posts()) : while ( $wp_query->have_posts() ) : $wp_query->the_post();      The problem is a weird result for the "top week" page. Just one post is shown and with a not corresponding number of votes. Any idea of what I'm doing wrong?


How to save double quotes in post meta, when the post meta data is an array?

Ok so I've been scratching my head on this one for a while. I'm making a plugin that adds a custom meta box to a custom post type. I'm using the update_post_meta function to save the data from the meta box - the data is complex and dynamic - users can add multiple fields etc etc. So the most appropriate way to save this data is by passing an array to the `update_post_meta` function using a single key (as per the docs, $meta_value is an array). This works best for my data in almost every way except 1... According to the docs WP will serialize any arrays passed to the `update_post_meta` function. The problem is some of the data will possibly contain double quotes, or any other string a user can input - and serializing the data will not work due to the double quotes breaking (usually I just get blank output after any point where a double quote occurs)... **Update - some example data to get an idea - the problem is using an array..:**               $clean_array['heading'] = 'This is a heading typed by a user "with double quotes"';     $clean_array['content'] = 'This is another key in a much more complex array';          //now save this array as per the docs:     update_post_meta( $post_id, 'my-data', $clean_array );          //then retrieve the data again somewhere else:     $my_array = (get_post_meta( $post_id, 'my-data', true ));          echo $my_array['heading'];     //outputs 'This is a heading typed by a user ' - it stripped anything where there was a double quote      After some research these are the only ways I can see to get round this are -   1. Run `htmlspecialchars` on the data before saving - but this breaks the paradigm used throughout WordPress which is to leave the data sanitizing on the way out of the database - it also feels like a bit of a dirty solution and doesn't properly escape all data...   2. `base64_encode` the data - but this means I have to decode the data wherever it is displayed - and it means that it is in general harder to manage/perform searches etc etc. _Note, I do not want to save the data separately using individual keys - it seems far too clunky and will result in a lot of DB bloat I'm sure_ Are there any WP functions or methods I have missed that might help automating with this? Or any other methods of preserving data and allowing things like double quotes when using this function with arrays? The docs are pretty unclear on the right way to escape data when using an array with `update_post_meta` and also any limitations associated. Thanks for any help in advance!


How can I hide certain sidebars from some users?

I'm working in wordpress multi site, but this question is relevant for regular use in wordpress. How can I hide certain sidebars from certain user groups (e.g. editors or admins) ? I have already tried the trivial:                   if(is_admin() && user_can(...)){            register_sidebar...         }      But this doesn't hide the sidebar, it shows that this sidebar is not active and the editor, for that matter, can still drag in and out as he or she pleases. Thanks.


Echo user id of users in seperate table

{            $ad_code = str_replace("xxxx",$_SESSION['user_id'],$resultset->description);         $ad_code = str_replace("XXXX",$_SESSION['user_id'],$ad_code);         echo '
';         echo ''.$resultset->name.'	';         echo '<textarea cols=65 rows=5>';         echo $ad_code;         echo "</textarea>	";                         echo '
';     }      I'm using a plugin called WordPress Affiliate Platform, which created (I think) users in a seperate table than the typical WP users so as not to mix affiliate users and WP users. I'd like to retrieve the user ID of the logged in affilite so I can list the affiliate's current page referral url:   * Example of a site wide referral url: `http://domain.com/?ap_id=AMEEKER`   * Example of a page specific referral URL: `http://domain.com/myproduct?ap_id=AMEEKER` The plugin itself doesn't offer that option, instead just giving the instructions to tell affiliates to paste `?ap_id=AMEEKER` after the current page URL to get their affiliate link. That's fine, but a little tedious and can open affiliates up to errors that aren't really their fault. I'm sure there's a way to just echo out the current page URL, followed by ?ap_id= and the affiliate's user id, but I'm having trouble figuring out how to retrieve the affiliate's user ID. The plugin itself does it by transforming xxxx to the user id somehow. `domain.com/myproduct?ap_id=XXXX` I've pasted above some code from the affiliate's dashboard, and area where the plugin DOES pull the affiliate's ID and display it dynamically for the logged in user. Looking at that template in the plugin's files, I found what I _think_ is the code that's dynamically turning XXXX into the actual affiliate ID but I don't know what to do with this, or if this alone can help me get what I want. I mean, I can look at it and KIND of see what it's doing, but not enough to know if or what I can do with it now! (not a programmer, more like a tinkerer). I've asked the plugin author, who seems to give very good support, but this feature has been requested it seems on their site several times and their answer is the same. No hard feelings, but I'd like to see if it can be done. Any help would be appreciated.


How to Remove Certain Screen Options and Meta Boxes from add/edit post type?

Now, when you add or edit a particular post within your desired post type, there are more screen options as well. Although, these Screen Options are showing/hiding meta boxes. I would like to be able to programmatically obtain a list of all of these registered Screen Options of meta boxes, so that I can again check if a certain array of Screen Options exist, and if they do, I plan on removing them programmatically. ![WordPress - Screen Options - Add or Edit Post - Meta Boxes](http://i.stack.imgur.com/4wtlm.png) Click Here For Full Size Screenshot **Question** How can I programmatically obtain a list of all registered Screen Options (meta boxes) on post types, where you want to add or edit a particular post within your desired post type. Ultimately, the goal here is to remove these options and not simply just disable them. I'm looking to do something along the lines of what I have accomplished for removing unnecessary dashboard meta boxes.


Shortcode for output of wp_get_archives displays at top of post

Why does the output of this function               // One Recent Post     function most_recent_post_shortcode() {         return wp_get_archives( 'type=postbypost&limit=1&format=custom');     }     add_shortcode( 'recent-post', 'most_recent_post_shortcode' );      and shortcode `[recent-post]` show the output at the top of a post rather than in the body of the post where the shortcode is? Is there a better way to use a shortcode and wp_get_archives (or other function) to display the title and link of a recent post? It seems to have something to do with this question: The result of a shortcode appear BEFORE page content


How to set-up multiple cron task with wp_schedule_event so that they do not overlap?

I'm using a cron to take data from Facebook and i have divided the job into three calls, to avoid making to many call all toghether, now how do i set up calls so that they don't overlap?               // Set the CRON for pages     wp_schedule_event(  current_time( 'timestamp' ), self::FB_CRON_FREQUENCY, self::FB_CRON_PAGES, array( Ai1ec_Facebook_Graph_Object_Collection::FB_PAGE ) );     // Set the CRON for groups     wp_schedule_event(  current_time( 'timestamp' ), self::FB_CRON_FREQUENCY, self::FB_CRON_GROUPS, array( Ai1ec_Facebook_Graph_Object_Collection::FB_GROUP ) );     // Set the CRON for users     wp_schedule_event(  current_time( 'timestamp' ), self::FB_CRON_FREQUENCY, self::FB_CRON_USERS, array( Ai1ec_Facebook_Graph_Object_Collection::FB_USER ) );      So i want all of the calls to run every two hours, but i want one to run at minute 15, one at minute 30 and one at minute 45 so that they do not overlap, how can i do that?


How to create an API for my plugin?

I have been developing plugins for WordPress, most plugins I have developed use two or three classes, hence not as huge as Buddypress or WooCommerce. I am planning to develop two open source plugins to deliver some sort of complex system (can't share details at the moment but later during development) where other developers can customize functions and the system for them needs to be the same as Buddypress and WooCommerce. As I check those plugins files and realize they have registered their own actions and filters which developers can modify as per need. However, my problem is being unable to completely understand, how I should write a plugin where others have the flexibility to override functions as well as add their own. I know that it is difficult to give a definite answer, but I need some sort of a start-up guide so I can go in the right direction. Do I need to register my own actions and filters? If yes how? if not then, what are my options? Your advice will help me a lot... Thanks


how to move another machine or server without dealing with IP

Wordpress website for a small company. i am able to install wordpress in IIS server. my doubt is when installing , i am giving the ip address as "192.168.0.101:87".Everything works fine.I created menus and related pages. It works fine.it can be accessed by other machine within in the office. what actually looking for "if i need to move the complete wordpress to other machine or to server i must change the ip address in database manually" otherwise it wont work. how can i solve the problem? please let me know in detail if any one can help me out thanks in advance


How to move a WordPress multisite?

I have a WP multisite installation like this:   1. www.mysite.com    2. www.mysite.com/anothersite Now, I'd like to move www.mysite.com/anothersite to be www.mysite.com. Is it possible?


Is there an application I can use to protect documents?

Essentially I would like to have a section of a site, separate from the WP admin, that can hold documents for registered users of a certain group to view accessible only by user/password. It would really be nice if the documents themselves could not be linked to or accessed by URL unless logged in. Please let me know of any suggestions!


Options.php loop won't show!

I'm creating an options panel for a theme on my localhost that's stored within the options.php file. My options panel will have two main loops. The first is to list the different sections and the second will create those sections. I just wrote the first loop and it doesn't display anything upon running. The code for this loop with some surrounding html is:
             <?php             foreach ($options as $value){                 switch ( $value['type'] ){                     case 'section':                         echo '
'.$value['name'].'
';                         break;                 }             }             ?>
                    I don't see anything wrong with this though. This brings me to believe that something is wrong with a different part of my code so here's the entire options.php file:               <?php          //theme vars     $themename = "Fuckin Round";     $shortname = "fuckinround";     $options = array();          function theme_options(){         global $themename, $shortname, $options;              $options = array (                  array("name" => "General Settings",                 "type" => "section"),             array("type" => "open"),                  array("name" => "Type of Logo",                 "desc" => "Select your logo type ( Image or Text )",                 "id" => $shortname."_type_of_logo",                 "type" => "select",                 "options" => array("text", "logo"),                 "std" => "text"),                  array("name" => "Logo Upload",                 "desc" => "Upload images using the native media uploader, or define the URL directly",                 "id" => $shortname."_logo_upload",                 "type" => "imageupload",                 "std" => ""),                  array("name" => "Logo Text",                 "desc" => "Enter text for logo",                 "id" => $shortname."_logo_text",                 "type" => "text",                 "std" => ""),                  array("name" => "Logo Slogan",                 "desc" => "Enter text for logo slogan",                 "id" => $shortname."_logo_slogan",                 "type" => "text",                 "std" => ""),                  array("name" => "Custom Favicon",                 "desc" => "Upload a 16px x 16px Png/Gif image that will represent your website's favicon",                 "id" => $shortname."_favicon_upload",                 "type" => "imageupload",                 "std" => ""),                  array("type" => "close"),             array("name" => "Styling Options",                 "type" => "section"),             array("type" => "open"),                  array("name" => "Background Color",                 "desc" => "Pick a color for the background",                 "id" => $shortname."_background_color",                 "type" => "color",                 "std" => "#ffffff"),                  array("name" => "Body Color",                 "desc" => "Pick a color for the body",                 "id" => $shortname."_body_color",                 "type" => "color",                 "std" => "#ffffff"),                  array("type" => "close"),             array("name" => "Footer Options",                 "type" => "section"),             array("type" => "open"),                  array("name" => "Copyright Text",                 "desc" => "Enter text for copyright in footer (if empty it will be removed)",                 "id" => $shortname."_footer_text",                 "type" => "text",                 "std" => "Copyright TestSite.com"),                  array("type" => "close")              );     }          //add options page     function fuckinround_add_admin(){         global $themename, $shortname, $options;              if ( $_GET['page'] == basename(__FILE__) ){                  if ( 'save' == $_REQUEST['action'] ) {                 //protect against request forgery                 check_admin_referer('theme-save');                      //save the options                 foreach ($options as $value) {                     if( isset( $_REQUEST[ $value['id'] ] ) ) {                         update_option( $value['id'], $_REQUEST[ $value['id'] ] );                     } else {                         delete_option( $value['id'] );                     }                 }                      header("Location: themes.php?page=options.php&saved=true");                 die;                  } else if ( 'reset' == $_REQUEST['action'] ) {                 //protect against request forgery                 check_admin_referer('theme-reset');                 //delete the options                 foreach ($option as $value) {                     delete_option( $value['id'] );                 }                      header("Location: themes.php?page=options.php&reset=true");                 die;             }         }         add_theme_page($themename." Options", "$themename Options", 'edit_themes', basename(__FILE__), 'fuckinround_admin');     }     add_action('admin_menu' , 'fuckinround_add_admin');          //main function     function fuckinround_admin() {         global $themename, $shortname, $options;              //saved or reset messages         if ( $_REQUEST['saved'] ) echo '

'.$themename.' settings saved.

';         if ( $_REQUEST['reset'] ) echo '

'.$themename.' settings reset.

';              //form         ?>
<?php echo $themename; ?>

                 <?php                 foreach ($options as $value){                     switch ( $value['type'] ){                         case 'section':                             echo '
'.$value['name'].'
';                             break;                     }                 }                 ?>
                                             <?php             //loop 2         ?>                                         <form method="post">                 <?php wp_nonce_field('theme-save'); ?>
                     <input name="save" type="submit" value="Save changes" class="button-primary" />                     <input type="hidden" name="action" value="save" />
             </form>                  <form method="post">                 <?php wp_nonce_field('theme-reset'); ?>
                     <input name="reset" type="submit" value="Reset changes" />                     <input type="hidden" name="action" value="reset" />
             </form>                  <?php     }     ?>      I've read through this code multiple times and can't find anything that would cause the loop not to work properly. I'd appreciate it very much if you guys could give it a look and let me know if you find anything. Thanks in advance. Sorry about the immature theme name btw.


How to Handle Distributed Development Workflow

I'm trying to come up with a workflow for two (right now) people. One of whom will be doing theme work and another who will be writing content. We are not co-located are will not be anytime soon. The writer is quite unfamiliar with source control, so that would best be a phase two kind of thing. I could put MAMP on her box and have her write there, if that is the approach, how best to integrate the two solutions? I've read this question: How to best setup for development for a two person bi-coastal team? but since it is two years old, I thought I would see if anything has changed.


Show Blog posts from other site to WordPress without RSS Feed

I have developed a WordPress theme for my Client for his Website. From a long time My client is operating his Blog on ThreeVillagePatch. He is an active member on this site and frequently adds new posts to this Site. Now that I have made new theme for his site, he wants me to show Blog posts from ThreeVillagePath.com to his own website North Shore injury Lawyer. Here, I am providing links for both, Please help me as to how can i fulfill this and show Blog posts posted on ThreeVillagePath.com to northshoreinjurylawyer Please Note: It would be ideal if i can show both excerpt and Full blog post content as well. Thank you in advance Chetan


Access to Media Library

Im trying to find a way to pull random images from either a post or wordpress's built in image library. Im not sure how to query image uris from a post or the media library - is there a tag or method that I can adopt?


Custom permalink with child taxonomy terms

This may ressemble other questions, but i'm posting my own as I couldn't find a conclusive answer that worked for me. **What you need to know** I have a custom post type (products), with a custom taxonomy (collections). My collections taxonomy is hierarchical. For example, I have a parent collection (bathroom) which will have a good number of sub collections. **What i'm trying to do** I'm trying to obtain permalinks for my products which include both the parent collection and the child collection, example                http://<domain>/products/bathroom/collection-1/postname      **What i've tried** Basically i've been playing around with the rewrite parameter when registering my CPT and Taxonomy, as well as the 'post_type_link' hook. I've managed to get it working _partially_ , that is, by displaying only the parent collection in the permalink. Any help would be greatly appreciated, thank you. Also, my permalink structure is : /%category%/%postname%/ **Some of my code** _Registering CPT / Taxonomy_                register_taxonomy( 'collection', array(  ), array(           'label' => 'collections',           'public' => TRUE,           'show_ui' => TRUE,           'hierarchical' => TRUE,           'query_var' => 'collections',           'rewrite' => TRUE      ));           register_post_type( 'product', array(           'label' => 'products',           'public' => TRUE,           'publicly_queryable' => TRUE,           'show_ui' => TRUE,           'show_in_menu' => TRUE,           'taxonomies' => array( 'collection' ),           'supports' => array( 'title', 'editor', 'author', 'custom-fields' ),           'rewrite' => array( 'slug' => 'products/%collection%', 'with_front' => false, 'hierarchical' => true )      ));          flush_rewrite_rules();      _post type link hook_                if( strpos( $permalink, '%collection%' ) === FALSE )           return $permalink;           $terms = wp_get_object_terms( $post->ID, 'collection' );      $tax_slug = "";           if( empty( $terms[0]->parent ) )      {           $tax_slug = $terms[0]->slug;// . "/" . $terms[1]-> slug;           //Second part 404's my permalinks, so commented out      }      else      {           $tax_slug = $terms[1]->slug;// . "/" . $terms[0]-> slug;           //Second part 404's my permalinks, so commented out      }           $permalink = str_replace( '%collection%', $tax_slug, $permalink );           return $permalink;


Can I prioritize post categories for choice for breadcrumb trail?

I'm using `Breadcrumb NavXT` for displaying breadcrumbs trail of given page, based on category tree. This works fine half of the time - the problem is I (ab)use categories to assign specific properties to given pages, which are then interpreted in post.php to render given post in a specific way, e.g. hide the title or format in a specific way. And `Breadcrumb NavXT` sometimes picks these "meta- categories" to render the breadcrumbs, instead of the main category. Is there a neat way to either get the plugin to include/exclude certain category trees, or make given categories "preferred" or replace the plugin altogether with something that would handle the problem better?


How can I make wordpress suppress mysql errors?

Wordpress has two functions related to SQL queries and their errors as mentioned in What Is The Difference Between suppress_errors() And hide_errors() in $wpdb? From what I've read setting `WP_DEBUG` to `false` in `wp-config.php` will set `hide_errors()` so that mySql errors aren't show - but if the site can't connect to the database you'll still error: > WordPress database error: [MySQL server has gone away]` Without modifying the core file `wp-includes/wp-db.php` and setting the line ~69 to   `var $suppress_errors = true;` (which is what I've done for now), how can I set `suppress_errors` to false without modifying the core?


Cant we use a PHP file directly like myhome.com/some.php?

i just want to add a php file into my site say www.mysite.com/some.php. I dont want to create any page using that php file as page template. All i want is to add a php file which as some php codes in it and redirects to my another page after successful access. I know it is possible and seen in many sites that they use it. How should I to do this???? any solution or at least an hint will help me.


Working with a modified WordPress & Theme and updating WordPress

I just inherited a site where the creator installed the Copperific Theme and then modified the source files to achieve customizations. My understanding of custom themes was that, in order to protect your modifications, you cloned the original theme and re-named it, housed it in its own theme folder etc. Is that correct? My concern is that when WordPress updates are available that customizations might be wiped out by the update process. Additionally looking at the mod dates of the core WP files shows a variety of dates leading me to assume the original developer edited these as well. Is that a reasonable assumption? Do I have to upload a copy of WP from that version and diff them to know? What would best practice dictate for this situation. No code comments, docs, or notes were left for me... ![enter image description here](http://i.stack.imgur.com/ohkCA.jpg)


Custom Post-type not returning the right child_of

**Situation** I am using the Advanced Custom Fields plugin to give Custom Post Types a checkbox. If this box is checked, it should be returned by this Query. The Query works this far. **The issue** The pages I want it to display are all childs of a page. And this Query returns all pages with the checkbox, instead of just the childs of the current page with the checkbox. **My code** _top of page_               <?php $tid = get_the_ID(); ?>      _Further along the page_               <?php       $i == 0;       global $post;       $myposts = new WP_Query(array(          'post_type' => 'keuringen',          'child_of' => $tid,          'meta_query' => array(              array(              'key' => 'first_to_load',              'value' => '1',              'compare' => '=='              )          )       ));     ?>      **The question** What can I do to make it return only the children? Or should this already return only the children and is this a bug in one of the plugins?


Want to increase the # of slides in FlexSlider in WooThemes Scrollider

I am using WooThemes Scrollider for a full screen homepage slide show. The client has chosen 14 slides to include, but the slider only lets me set 10. Is there a way to change the maximum # of slides allowed in FlexSlider? Thanks so much!


How to remove permalinks links presents in each page of my site?

I have this WordPress static site: http://www.saranistri.com/ As you can see at the end of each page there is a link named **Pemalink** into a box. I want to remove this box and this link. Can I do this operation directly from the WordPress backend or have I to remove it directly from the code of my template? Tnx Andrea


Does update_comment_meta hook exists?

Its been 3 days now I am fighting to resolve the issue here: An action hook where a comment meta is updated I am pretty sure, even if I am a beginner, that the hook `update_comment_meta` doesnt exist, and that it is not possible to use something like:               add_action( 'update_comment_meta', 'do_soemthing', 10, 4);      Any confirmations, or objections are highly welcomed.


Pass a comment id through url and append the comment post's slug in the url

Here's the scenario: I wrote a custom url rule to pass a comment id to a template and display the comment and comment meta as a single page (`eg. http://example.com/reply/56`) and it works fine. But now I'm trying to refine this rule to include the comments post slug in the URL. So when I visit `'http://example.com/reply/56'` it should map to `'http://example.com/the- post/reply/56'`. I'm actually stuck at this point. Here's what I've done till now: The rule that works:               <?php      add_rewrite_rule( '^reply/(.*)?$', 'index.php?pagename=reply-page&reply_id=$matches[1]', 'top' );     ?>      Added a `query_var` `'reply_id'` for this. Now the code I'm trying:               <?php     add_action('init', 'test');     function test()     {         $reply_struct = '/reply/%reply_id%';         $wp_rewrite->add_rewrite_tag('%reply_id%', '([^/]+)', 'reply_id=$matches[1]');         $wp_rewrite->add_permastruct('reply_id', $reply_struct, false);     }          add_filter('post_type_link', 'reply_permalink', 10, 3)     function reply_permalink()     {         $rewritecode= array(             '%reply_id%'         );              $test = '';         if ( strpos($permalink, '%reply_id%') !== false )          {             $i = get_query_var('reply_id'); //Trying to get the comment id, this is where I'll get the post slug and append it to the url             $test = 'test';          }               $rewritereplace = array(            $test          );          $permalink = str_replace($rewritecode, $rewritereplace, $permalink);          return $permalink;     }      I think when I access the URL `'http://example.com/reply/56'`, I should get `'http://example.com/test/'` or `'http://example.com/reply/test'`. But I'm not.


Flexslider Slider Post

I'm trying to figure out how to slide a post using flexslider but its not sliding. i want to display only one post from category Featured so i use 'posts_per_page' => 1 but if i use 3, all the from from category are displaying, can anybody help me? thanks. this is my code.. header.php                             <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset') ?>" />         <meta name="generator" content="Wordpress <?php bloginfo('version'); ?>" />         <title><?php bloginfo('name'); ?> <?php wp_title(); ?></title>     <?php wp_enqueue_script("jquery"); ?>     <link rel="pingback" href="<?php bloginfo('pingback_url') ?>" />     <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />     <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/flexslider.css" />     <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Lato:400,900italic,900,700,700italic">     <?php wp_head(); ?>          <?php echo is_single() ? "" : ""; ?>

                 <a href="<?php bloginfo('url'); ?>"><img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="" />

<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Contact') ) :                  else : ?>
Dashboard > Appearance > Contact
                 <?php endif; ?>

                     <?php wp_nav_menu ( array('container_class' => 'main-nav', 'container' => 'div')); ?>

      index.php

                     <?php                         $args = array('category_name' => 'Featured', 'posts_per_page' => 1);                         $query = new WP_Query( $args );                         while ($query->have_posts()) : $query->the_post();                     ?>

<?php the_title(); ?>
                         <?php the_excerpt(); ?>
                         <?php the_post_thumbnail(); ?>
                         <?php                                 endwhile;                         ?>

      footer.php


Delete duplicate rows from wordpress database where a column is duplicate in phpmyadmin

I have a wordpress table like so (phpmyadmin and MySQL)               | id |  meta_key | meta_value |     +----+-----------+------------+     | 1  | import_id | abc        |     | 2  | import_id | abc        |     | 3  | import_id | def        |     | 4  | import_id | xyz        |     | 5  | import_id | xyz        |     | 6  | import_id | xyz        |     | 7  | something | 123        |     | 8  | something | 234        |     +----+-----------+------------+      I need get the id of all duplicate rows where meta_key='import_id' inorder to remove them from another table. I want to keep the MIN(id) of each of the returned rows where 'meta_value' is the same i.e the output should be:               | id |  meta_key | meta_value |     +----+-----------+------------+     | 2  | import_id | abc        |     | 3  | import_id | def        |     | 6  | import_id | xyz        |     +----+-----------+------------+      or just               | id |     +----+     | 2  |      | 3  |      | 6  |      +----+      please help as while this may be a duplicate question I am still having trouble as my SQL is a bit rusty. I can get duplicates where meta_key='import_id' like so:               SELECT id,meta_value     FROM TABLE      WHERE meta_key='import_id'     GROUP BY meta_value     HAVING Count(meta_value) > 1      and I want from this the NON MIN(id) values


FOUND_ROWS() returns maximum rows in table

I am pretty new to word press, but I am not understanding what I am doing wrong. According to this tutorial (http://dev.mysql.com/doc/refman/5.0/en/information- functions.html#function_found-rows) the SQL statements are correct, but the results are incorrect. Here is my php code. Table contains 101,000 rows               $myrows = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS col1, col2, FROM table_name ORDER BY col1 ASC LIMIT 1,5;" );      // count($myrows) returns 5 correct          $rowCount = $wpdb->get_var( "SELECT FOUND_ROWS();" );      // returns value of 101,000. Incorrect.      What am I doing wrong? How do I get FOUND_ROWS() to return 5? Thanks in advanced.


tinyMCE 4.0 custom button onclick no longer working

I am trying to update one of my WordPress plugins where I create a tinyMCE button and open up a thickbox on click. I've just tried switching over to a basic example for testing, and can't get this to work either.                   onclick : function() {             ed.insertContent('Main button');         }


Plugins not showing in Multisite dashboard

I have been trying to upload more plugins and even though the files are all located in content/plugins directory, nothing is showing up in the dashboard. Even the default plugins are not showing. Does anyone know why this may be?


Search broken due to uComments - I found the JS file that is causing the problem

I was unable to search my site until I ran the plugin Deactivate/Activate test. It was uComments. This plugin has a file called functions.js which is causing this problem. I do understand it has something to do with the validation, but I really need the help with the JS code. Thanks


Help with filter for wp_notify_moderator()

I have a case where I have multiple Administrators. Not all of them want to be notified per email when there was a comment posted or is held for moderation. The Settings > Discussion page only allows for the control of comment moderation emails for all Admins, not for selected ones. Responsible for the emails being send is this function: http://wpseek.com/wp_notify_moderator/ Within that function there is an array stored in a variable called $emails and the first value that is being stored is **get_option('admin_email')**. The second value (email) is that of the **post author**. At the end of the function there are some filters one of which let's you modify the $emails array and so far I got the following. But this is not working, any ideas why?               // Don't email webmaster for comment moderation     add_filter( 'comment_moderation_recipients', 'pref_dont_email_webmaster', 10, 2 );     function pref_dont_email_webmaster( $emails, $comment_id ) {         $webmaster_email = 'name@address.xmp';         if ( $emails[0] == $webmaster_email )             unset($emails[0]);         return (array) $emails;     }


help needed for suit designing tool

I am working on a theme which has options for suit & shirt designing. Basically, I am stuck in creating taxonomies for suits & shirts. Reference Link Problem I am facing is to plan how the taxonomies should go: e.g.   1. type:      * suit        * jacket          * style & measurement options       * trouser          * style & measurement options     * shirt        * style & measurement options now this is something in my mind, but there are also some things to think of, when I will select a suit and go for jacket options or trouser options, I have to load image for each style option and show the user how the finished product will look like. Any suggestions will be appreciated as all these options are required to be configurable from admin panel.


Reply form used in wordpress.com

The reply form that comes originally with wordpress is, well, so big and annoying. While the one that appears on wordpress.com blogs is very elegant and feature-ful. Does the one used in wordpress.com exist as a pre-made plugin? If so, where can I get it from? If no however, how can make it by hand, i.e, what are the guidelines to do that? Thanks in advance.


HowTo: Add Class to Sidebar Widget List-Items

The newest version of Bootstrap (v3.0) adds a new **List Group** component which has the following structure:

Cras justo odio

Dapibus ac facilisis in

Morbi leo risus

Porta ac consectetur ac

Vestibulum at eros

        1. I would like to be able to add a class to the `ul` (i.e. `<ul class="list-group">`)   2. I would like to style my **_Category_** sidebar widget to support this new component, but as you see, this requires classes on **_each_** `li` item. In reading some similar posts, one option I found is to use jQuery to add the class to each `li`, but I am concerned about the dreaded **_FOUC_**. Is there some WordPress function that gets me to my goal? Please advise, **Update:** I was able to add classes to the individual `li`'s by creating a Custom Walker which extends `Walker_Category` (see code below), but this still does not get me to the `ul` which also needs a class added (eg `<ul class="list-group">`).               class Walker_Category_BS extends Walker_Category {         function start_el( &$output, $category, $depth = 0, $args = array() ) {             extract($args);                  $cat_name = esc_attr( $category->name );             $cat_name = apply_filters( 'list_cats', $cat_name, $category );             $link = 'description) )                 $link .= 'title="' . esc_attr( sprintf(__( 'View all posts filed under %s' ), $cat_name) ) . '"';             else                 $link .= 'title="' . esc_attr( strip_tags( apply_filters( 'category_description', $category->description, $category ) ) ) . '"';             $link .= '>';             $link .= $cat_name . '';                  if ( !empty($feed_image) || !empty($feed) ) {                 $link .= ' ';                      if ( empty($feed_image) )                     $link .= '(';                      $link .= 'term_id, $category->taxonomy, $feed_type ) ) . '"';                      if ( empty($feed) ) {                     $alt = ' alt="' . sprintf(__( 'Feed for all posts filed under %s' ), $cat_name ) . '"';                 } else {                     $title = ' title="' . $feed . '"';                     $alt = ' alt="' . $feed . '"';                     $name = $feed;                     $link .= $title;                 }                      $link .= '>';                      if ( empty($feed_image) )                     $link .= $name;                 else                     $link .= "';                      $link .= '';                      if ( empty($feed_image) )                     $link .= ')';             }                  if ( !empty($show_count) )                 $link .= ' (' . intval($category->count) . ')';                  if ( 'list' == $args['style'] ) {                 $output .= "\t
term_id;                 if ( !empty($current_category) ) {                     $_current_category = get_term( $current_category, $category->taxonomy );                     if ( $category->term_id == $current_category )                         $class .=  ' current-cat';                     elseif ( $category->term_id == $_current_category->parent )                         $class .=  ' current-cat-parent';                 }                 $output .=  ' class="' . $class . '"';                 $output .= ">$link\n";             } else {                 $output .= "\t$link
\n";             }         } /* end start_el */          } /* end Walker_Category_BS */      **Update 02:** After viewing `default-widgets.php` in the core, I decided to create a new widget (`WP_Widget_Categories_BS`, see code below) wherein I basically, copied all the code from the default category widget and simply modified the the `UL` to add the necessary class.               <?php           /**      * Categories widget class      *      * @since 2.8.0      */     class WP_Widget_Categories_BS extends WP_Widget {              function __construct() {             $widget_ops = array( 'classname' => 'widget_categories_bs', 'description' => __( "A list or dropdown of categories for Bootstrap 3.0" ) );             parent::__construct('categories', __('Boostrap Categories'), $widget_ops);         }              function widget( $args, $instance ) {             extract( $args );                  $title = apply_filters('widget_title', empty( $instance['title'] ) ? __( 'Categories' ) : $instance['title'], $instance, $this->id_base);             $c = ! empty( $instance['count'] ) ? '1' : '0';             $h = ! empty( $instance['hierarchical'] ) ? '1' : '0';             $d = ! empty( $instance['dropdown'] ) ? '1' : '0';                  echo $before_widget;             if ( $title )                 echo $before_title . $title . $after_title;                  $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h);             if ( $d ) {                 $cat_args['show_option_none'] = __('Select Category');                 wp_dropdown_categories(apply_filters('widget_categories_dropdown_args', $cat_args));     ?>                    <?php             } else {     ?>
     <?php             $cat_args['title_li'] = '';             wp_list_categories(apply_filters('widget_categories_args', $cat_args));     ?>
     <?php             }                  echo $after_widget;         }              function update( $new_instance, $old_instance ) {             $instance = $old_instance;             $instance['title'] = strip_tags($new_instance['title']);             $instance['count'] = !empty($new_instance['count']) ? 1 : 0;             $instance['hierarchical'] = !empty($new_instance['hierarchical']) ? 1 : 0;             $instance['dropdown'] = !empty($new_instance['dropdown']) ? 1 : 0;                  return $instance;         }              function form( $instance ) {             //Defaults             $instance = wp_parse_args( (array) $instance, array( 'title' => '') );             $title = esc_attr( $instance['title'] );             $count = isset($instance['count']) ? (bool) $instance['count'] :false;             $hierarchical = isset( $instance['hierarchical'] ) ? (bool) $instance['hierarchical'] : false;             $dropdown = isset( $instance['dropdown'] ) ? (bool) $instance['dropdown'] : false;     ?>
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:' ); ?>             <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" />

<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>"<?php checked( $dropdown ); ?> />             <label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e( 'Display as dropdown' ); ?>
                  <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>"<?php checked( $count ); ?> />             <label for="<?php echo $this->get_field_id('count'); ?>"><?php _e( 'Show post counts' ); ?>
                  <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('hierarchical'); ?>" name="<?php echo $this->get_field_name('hierarchical'); ?>"<?php checked( $hierarchical ); ?> />             <label for="<?php echo $this->get_field_id('hierarchical'); ?>"><?php _e( 'Show hierarchy' ); ?>
     <?php         }          } // end WP_Widget_Categories_BS      Combined with a Custom Walker I created (`Walker_Category_BS`) I now have what I wanted. **Analysis** Is this the best way to do it? **Don't know** as I have have received zero feedback so far, and this is the first time i've done this (hence the question), but ...it works! I could use a review. **Debug Warning** Concerning my Custom Category Walker `Walker_Category_BS`, i'm seeing this message > "Strict standards: Declaration of Walker_Category_BS::start_el() should be > compatible with Walker::start_el(&$output, $object, $depth = 0, $args = > Array, $current_object_id = 0) in C:\wamp\www\mysite\wp- > content\themes\mytheme\assets\inc\Walker_Category_BS.php" It appears to be a warning, of some sort.


Query posts than have a lapse of time active

First of all, sorry guys for my poor english. OK, i wanna make a query for show posts that doesn´t passed 3 days from it publication. I set a field for the expire date when it´s published (the time is in unix and i have added the 3 days in this field when it saves to the db), so i have the expire date set it. But my problem is make a query using the `meta_query`, i found in several posts how easy is to change the status of all posts but what i need is make this query work beside the status. This is my code                $q = array (             'paged' => $paged,            'meta_key' => '_rrhh_expire',            'orderby' => 'meta_value',            'meta_query' => array(               array(               'key' => '_rrhh_expire',               'value' => time(),               'compare' => '>=',               'type' => 'DATE'               )           )       );       query_posts($q);


Make WP not format code, not insert line breaks in between tags

Gahhhh! Are you kidding? Ok, I guess wp wants my source code all nice and formatted...               i'm a link

list item

      becomes
i'm a link

list item

      Ok, so it puts a unclosed p tag, that sucks, but who cares. Also, I wouldnt care about the formatting, but when you put a (script) tag in there, it bumps it down 2 lines, so then it gets wrapped in a (p) tag of its own.
      actually, yeah, again with the unclosed p tag... This stuff is coming from a shortcode function, on which i'm running               function stripNewLinesPreg($str){     $str=preg_replace("/(\\t|\\r|\\n)/","",$str);       return $str;     }      So... I've tried the no_texturize_shortcodes filter. Seems to do nothing.


WOW Slider doesn't animate between slides

I have installed WOW Slider for windows from here. And created some slides for wordpress. Next, published that for wordpress then tried to use that in a theme. And then in wp clicking on `WOW Slider` and `Add New`, added successfully. Next, added following statements to `index.php` :               <?php wowslider(2); ?>      After saving that, WOW slider shows successfully up but doesn't slide between images. Please tell me what am i missing here ? Any helps would be appreciated. P.S : I have installed WOW Plugin successfully.


Put update-like notification bubble on multiple CPTs menus for pending items

Much like how the Plugins or Comments menu items have these number notifications in a bubble for updates and unmoderated comments respectively, I'd like to use that bubble to display the number of CPTs which have a "Pending review" status. How to go about doing that? I have found this thread, but not quite sure where to go from there. That would be neat to have; as I need this feature on a site that uses user- generated content (custom post types). Whenever users submit a new CPT, its status is set to "Pending review", and I want the site admins to quickly glance at the menu to see how many items need their attention. **EDIT:** I now have this code:               // buuble notifications for custom posts with status pending     add_action( 'admin_menu', 'add_pending_bubble' );          function add_pending_bubble() {         global $menu;              $custom_post_count = wp_count_posts('custom-post-name');         $custom_post_pending_count = $custom_post_count->pending;              if ( $custom_post_pending_count ) {             foreach ( $menu as $key => $value ) {                 if ( $menu[$key][2] == 'edit.php?post_type=custom-post-name' ) {                     $menu[$key][0] .= ' ' . $custom_post_pending_count . '';                     return;                 }             }         }     }      ...which does work, albeit a bit inconsistent. Sometimes displaying, sometimes not. Also, if I have multiple CPTs, how do I apply this code for each and every menu item of those CPTs? The above code will work with only one CPT.


Avoid posting duplicate title posts

I really like how StackExchange sites handle posts, where after you finish typing the title, it will list out similar titles. Is there a plugin or a tutorial to make this happen for self hosted wordpress sites?


Calling Custom Fields within a category loop?

What I'm trying to do is to display a specific category post listing within a page template, showing only each post's custom fields, which must be pulled and included within the following html. What I also need is for the loop to stop after 10 items and give the option to go to previous items. here is the html I want to use for the custom fields.

            //here goes the image custom field

// here goes the item title custom field

//here goes the description custom field

ANCHOR TEXT


Newlines in Wordpress.com blog?

I just set up a blog on Wordpress.com, and the problem is, if I write:               something something          blah blah      That empty line in between doesn't show up! What can I do about this?


Has wp_get_attachment_image_src changed from 3.2.1 to 3.5.2?

I just upgraded my app from 3.2.1 to 3.5.2 and now I'm having an issue where my image `src`s are blank in one of my pages. The databases are identical (since I just did a mysql dump/restore a few minutes ago). Here's my code: category-legends.php:               if(file_exists($_SERVER{'DOCUMENT_ROOT'}.substr($fivesdraft->guid_legend,20)))         {                           $featured = gangmei_get_the_post_thumbnail_url( $fivesdraft->ID );            echo '

post_name.'">name.'" />

post_name.'">'.$fivesdraft->name.'

';         }      functions.php:                   function gangmei_get_the_post_thumbnail_url($post_id = NULL) {             global $id;             $post_id = (NULL === $post_id) ? $id : $post_id;             $src = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), 'full');             $src = $src[0];             return $src;         }      get_post_thumbnail_id($post_id) is returning an ID, so I'm thinking that maybe there's something wrong with `wp_get_attachment_image_src`. Can anyone lead me in the right direction? How would I debug this? The old version works fine (all images have a `src` and show properly) but my other environment doesn't. It's producing images like this: `<img alt="Nick Aries" src="">` ===== var_dump( $src );               bool(false)


Confused about the correct functioning on Wordpress Menus

good evening, Im been having some kind of problem with a specific, and as far as I can see, simple WP project, specifically with how to use the wp_nav_menu function, normally, when I try to create a WP Menu I use something like this:               <?php wp_nav_menu( array('menu' => 'Main', 'container' => 'nav' )); ?>      And always use the same function on my functions.php document which is:               add_theme_support('nav-menus'); if ( function_exists('register_nav_menus')) {register_nav_menus( array('main' => 'Main Nav') );}      The thing is, when I try to use that code to convert my HTML menu into a WP menu nothing works, then, reading something I tried with this:               <?php wp_nav_menu( array('menu' => 'Main', 'container' => '', 'container_class' => '', 'menu_class' => '', 'menu_id' => '' )); ?>      But that missed a few things like icons on each button and the color which was gone as well, the menu in HTML is this one: http://pastebin.com/n17C9Arv So my question is basically, what am I missing?, why I'm not being able to reproduce the converted wp menu exactly like the html menu? Driving me crazy.... Thanks guys! Arturo


Previewing Draft shows white page, publishing works fine?

I haven't run into this issue before. On my site, if I create a draft of a page and I save the draft and preview it, I get a blank white screen. However, if I publish that page, it shows up just fine. I'm not sure what could be causing this, but I'm stumped. I'm using the default page template and not putting any content into the page (it's just a blank page for testing). I enabled wp_debug but nothing showed up there OR in the php error log for this page. Has anyone else had this kind of error? I assumed that if it was erroring on the draft, it should error out on the published side to, but it's not. Thanks for any help you can give.


Custom Post Types, Taxonomies and Terms... I'm getting confused now!

Hopefully I can explain this correctly, as I'm getting confused myself now with what I want to achieve! I have two Custom Post Types, "Students" & "Boats" In "students" I have the Taxonomy "Classes" and then Taxonomy Terms of; "Class of 2012", "Class of 2011" etc. etc. In "boats" I have the Taxonomy "Projects" and then Taxonomy Terms of; "Class of 2012", "Class of 2011" etc. etc. What I'd like to do is: On the 'Class of 2012' page for students, I currently have a list of all the students, that's no problem and it's working well. What I'd like is to also display all the boats from the "Class of 2012" boats taxonomy term on the same page. That's where I'm having trouble. Ideally I'd like to get all the 'boats' in the 'Class of 2012' taxonomy by saying something like: get all posts from the boats post type in the taxonomy term of the same name as current taxonomy term. Does that makes sense?!


How get the 10 most viewed pages (not post)

I would like to know how it's possible to get the 10 most viewed pages ? I know how make it with post, but not with page... Thanks for your help.


Custom Post Type permalink not working on new posts

I've been struggling for a while with this and would really appreciate any help. I have a custom post type 'venues' on a site I'm working on. I have the permalinks setup so they are as follows: http://www.site- name.com/venues/venue-name This has worked fine 'til now. But whenever I add a new venue the permalink on it doesn't seem to work - it simply goes to a blank white page. I'm unsure how to go about fixing this since it's working on all the previous venue entries. Below is the relevant code for the Custom Post Type:               function venues () {     $labels = array(         'name'               => _x( 'Venues', 'post type general name' ),         'singular_name'      => _x( 'Venue', 'post type singular name' ),         'add_new'            => _x( 'Add New', 'venue' ),         'add_new_item'       => __( 'Add New Venue' ),         'edit_item'          => __( 'Edit Venue' ),         'new_item'           => __( 'New Venue' ),         'all_items'          => __( 'All Venues' ),         'view_item'          => __( 'View Venues' ),         'search_items'       => __( 'Search Venues' ),         'not_found'          => __( 'No Venues found' ),         'not_found_in_trash' => __( 'No Venues found in the Trash' ),         'parent_item_colon'  => '',         'menu_name'          => 'Venues'     );     $args = array(         'labels'        => $labels,                     'taxonomies'            => array('category'),              'description'   => 'This is where all of the venues in the Find Us section are held',         'public'        => true,         'menu_position' => 5,         'supports'      => array( 'title', 'thumbnail'),         'has_archive'   => true,                     'rewrite'                    => array('slug' => 'venue'),          );     register_post_type( 'venues', $args );     }


Shortcode issues in wp job manager plugin

I need to display job listings as per job types using shortcode in posts/pages. For that i have installed http://wordpress.org/plugins/wp-job- manager/ plugin. The issue is, when i place two shortcode in page one after another, it shows only final shortcode output. For example, [jobs job_types="Part Time"] [jobs job_types="Full Time"] The output shows only full time job listings alone. I came to know the issue with ob_start() and ob_get_clean(). I'm not able to fix it. Can any one check this and give me solution / help?


Custom Post Type Specific Post Template

I created a Custom Post Type, and here's the entire code:               // Register Custom Post Type     function wrestler_register() {              $labels = array(             'name'                => _x( 'Wrestlers', 'Post Type General Name', 'text_domain' ),             'singular_name'       => _x( 'Wrestler', 'Post Type Singular Name', 'text_domain' ),             'menu_name'           => __( 'Wrestler Profiles', 'text_domain' ),             'parent_item_colon'   => __( 'Parent Item:', 'text_domain' ),             'all_items'           => __( 'All Items', 'text_domain' ),             'view_item'           => __( 'View Item', 'text_domain' ),             'add_new_item'        => __( 'Add New Profile', 'text_domain' ),             'add_new'             => __( 'Add New', 'text_domain' ),             'edit_item'           => __( 'Edit Item', 'text_domain' ),             'update_item'         => __( 'Update Item', 'text_domain' ),             'search_items'        => __( 'Search Item', 'text_domain' ),             'not_found'           => __( 'Not found', 'text_domain' ),             'not_found_in_trash'  => __( 'Not found in Trash', 'text_domain' ),         );         $rewrite = array(             'slug'                => 'wrestler',             'with_front'          => true,             'pages'               => false,             'feeds'               => false,         );         $args = array(             'label'               => __( 'wrestler_profiles', 'text_domain' ),             'description'         => __( 'Profiles of WWE Superstars & Divas', 'text_domain' ),             'labels'              => $labels,             'supports'            => array( 'title', 'thumbnail', 'custom-fields', ),             'hierarchical'        => true,             'public'              => true,             'show_ui'             => true,             'show_in_menu'        => true,             'show_in_nav_menus'   => true,             'show_in_admin_bar'   => true,             'menu_position'       => 5,             'menu_icon'           => url + '/icon.png',             'can_export'          => true,             'has_archive'         => false,             'exclude_from_search' => false,             'publicly_queryable'  => true,             'rewrite'             => $rewrite,             'query_var'           => 'wrestler',             'capability_type'     => 'page',         );         register_post_type( 'wrestler_profiles', $args );          }          // Hook into the 'init' action     add_action( 'init', 'wrestler_register', 0 );      Now, I have also added single-wrestler.php to my theme's root, but every time I'm viewing the page it lands on "Single.php". Thanks.


Editing image dimension - to edit the main image file

When started blogging, I was not aware about the image file's size, and used a lot wider and sharper images without necessity, some of the files are even 5-7mb in size. As there's no such necessity to using such a large file, even the end-user have to wait for a long time loading such images. I know I can replace images via WordPress Media Library, but to replace images, I have to upload a new resized, squeezed version of the image to the server and then to delete the older one. Now I got another nice solution -- using the Media Library Image Edit option: With this, I can rescale the image, suppose an image originally was of 1830 × 2619, now I want it to recale to 629 × 900, then I can easily do it. ![enter image description here](http://i.stack.imgur.com/I0Ad3.png) But, I was actually doing it to reduce the file size (with its dimension) to make a big difference in the occupied Server Disk Spaces. But after the rescale there's a dropdown panel on the right saying: > **Restore Original Image**   >  _Discard any changes and restore the original image. Previously edited > copies of the image will not be deleted._   >  `Restore Image` That seriously means:   1. The Original file still resides there (so the original disk space still remains)   2. There's a newly sized image added there (additional disk space is occupied) But I's actually trying to replace the Original with the newly scaled image. Is that possible? The problem is, after the rescale, I can easily delete the Original using Cpanel, but isn't that cause many other db path errors and db errors that, the Original file is missing? I'm actually in an unanswered and uncertain state, I'm afraid. :(


Performance of my permalink structure?

I have read the discussion on the performance of different permalinks on the wp hackers mailinglist, THIS forum and around Google. I could however not really deduce if the permalink structure I have been using for the past years is good or not:               /%postname%-%year%%monthnum%%day%.html      This combination put the postname directly after the / and the year,month,day combination makes it more unique since many postnames carry the same name. The html addition is something I have been using for the past 10 years on my blog (even pre wordpress) so that is legacy. I dont know if this is good for permance or bad for performance, how can i check this? (I have been running the blog for +10 years and there are about 10.000 posts with many links in) links:   1. http://codex.wordpress.org/Using_Permalinks   2. http://www.google.com/search?q=wordpress+category+permalink+performance   3. http://ottopress.com/2010/category-in-permalinks-considered-harmful/   4. http://lists.automattic.com/pipermail/wp-hackers/2010-October/035458.html


What are people using for displaying Image / Media copyright information?

I have tried the 'Image Credit' plugin but it seems flaky (possibly due to interaction with other plugins). What are other people using? The requirement is for each image used to have an associated field for copyright info.


Filter Menu Items by Custom User Role in a page

I want to create a page template where the contents of the menu is filtered. Say, on Template 1, I want only the pages/post created by a custom access role areamanager1 to be displayed on the Menu on all the pages that uses the Template 1. And the same goes with Template 2, etc. At first, I thought of creating a separate menu for each template on the widget panel **BUT** that's not practical for me because it would require the admin to constantly update the menu for each template everytime a new page/post is added. Any ideas on how to implement it? I would really appreciate any help. Alright, I am thinking if someone knows the dissected version of this function?               <?php if ( ! dynamic_sidebar( 'sidebar-6' ) ) : ?><?php endif; // end sidebar widget area ?>      I think that would help a lot. Cause I can edit the database query to display the posts/pages on the menu widget. Thank you.


Commit changes to WordPress Plugin SVN with TortoiseSVN

I'm trying to upload my plugin for the first time to the WordPress SVN. I've been granted access from the WordPress team. I am able to download the directory. Then I try to place my plugin files into the `trunk` folder, and then commit the changes. When I do this. I am prompted for my login credentials. I use the same ones that I use on the Wordpress.org website. However, it keeps re-prompting me to enter my credentials. I am not sure what I am doing wrong. I made a screencast of the process. http://www.screencast.com/t/3QCfSdyM


Get first category only and excluding one

How can I get the first category (linked to the category archive page) of a post excluding the category called 'featured'? I found various solutions but I can't combine them properly. Thanks UPDATE: This is what I ended up using:               $category = get_the_category();      $cat_id = get_cat_ID( $name );     $link = get_category_link( $cat_id );          if($category[0]->cat_name == "featured") {          echo ''. $category[1]->cat_name .'';     } else {          echo ''. $category[0]->cat_name .'';     }


Page Restriction and Redirect for Particular Levels or user

I am planning to have a page restriction and redirect for the particular level of users, but I dont have any idea how to implement that. Here's an example of what I want to achieve I have a page lets say for example "News" page, and I want it to be accessible for all Gold Members. If Silver users tried to access it. they should be redirected to any page where I wanted them to be redirected. Is this possible. I almost forgot to mention, I am using WishlistMembership Plugin.. I already asked some support from Wishlist but no reply so far.


Custom post types

I have made a custom post type called "Case Studies". There is a case studies page which displays the title of every custom post and a small exceprt. However when you click on the title to view the single post, on the navigation the current tab changes from "`Case studies`" to "`News`". Where news is the default post page and case studies is a templated page. Is there a way to make the custom post type a child of the `Case Studies` page? Or atleast set a template file that I can use for the custom post type. When you view a single `case study` post I need the navigation to show that you are still on the `Case Studies` page and not on News. Thanks


Prompting for review / reapproval of page content

I have a fair amount of content in wordpress pages that gradually gets out of date over time. I can have an 'offline' process to set reminders in my calendar to remind me to review particular pages and bring them up to date. However I was wondering if there is a way (with a plugin perhaps) to have WordPress put the pages into a 'needs review' state a certain amount of time after it was last edited. This would keep the page live, but prompts me to review the content.


Is it possible to load plugin from console with core ?

I developing some scrapping plugin for my own purpose. So each 10 minutes i need to start my plugin from the cron. Plugin will parse some posts from other pages and add it to wp. So is it possible to load plugin with wp core from console?


How to filter post from categories only if the posts appears in one of them, not the other?

The scenario is, some posts have one category, ok. Some others have more than one category. I must create post with content and also slideshow thumbnails for use with Nivo plugin gallery. Ok. I want to filter all the posts in the "slideshow" category when in index pages, so I use a simply query_posts($query_string . '&cat=-1,-36'); Category number 1 is "Undefined", and number 36 is "Slideshow". Ok. But... I have some posts that have another category, lets say, number 50, "Applications" and I wanna show these posts, despite they are too in "Slideshow" category. I cannot find the way to say WP "show me posts, except the ones in categories 1 and 36, but show me them if they have more categories". Googling and reading a ton of docs and pages I haven't found any way to know the categories count by post (not how many posts by category), maybe to build a query like "show me that, filter that EXCEPT if count(categories are my post present) > 2 ). Some ideas? Thank you!


How can you handle rewrite rules for custom post types with option to filter on custom taxonomy terms?

I have seen this question but can't wrap my head around actually filtering on the taxonomy as well.. Essentially what I'm looking for is an archives page for the taxonomy such as mysite.com/movies (which the previous question answers), but to filter on custom taxonomy within the custom post type such as Settings => New York, Berlin so that you can use links such as mysite.com/movies/new-york. Any pointers as to what my rewrite rules should be would be greatly appreciated.


WP-e-Commerce and W3-Total-Cache integration problem

My shopping cart is being cached by w3 total cache. This is the expected default behaviour. The thing is I can't find an easy solution for this. I am showing my shopping cart on almost every page, so using rejected cookies or something similar is not an option. Is it possible to tell w3 total cache not to cache a single php file like cart_widget.php? Or some other workaround? I know there is the possibility to load the cart via ajax as the plugin does not cache GET requests with parameters (by default). Still, I would like to avoid that extra request. EDIT: Also, w3 total cache is not regenerating the page when I edit the product, is there an easy way to tell w3 total cache to empty the cache for a single page?


404 Error on Activate / Deactivate Plugin

I have a standard WP install (3.5.1) and am trying to activate a new plugin (WP Super Cache) however each time I try to activate it, I get my site's 404 error page... which is strange as it's the same page (wp-admin/plugins.php) as the plugin list page I'm activating from, but with a query string. Stranger still is that I cannot deactivate, or activate any of my other plugins?!? I haven't changed the `.htaccess` file or made any changes to the permalink structure and can't seem to nail down what is going on? There doesn't seem to be any resource on this anywhere; anyone have any ideas? Any help would be greatly appreciated!


How do I unset all of the select boxes for pages

I am using WooCommerce and need to recreate the default pages. The answer given is   1. Go to WooCommerce > Pages and unset all of the select boxes for the pages (including the shop base option).   2. Deactivate the WooCommerce plugin   3. Activate the WooCommerce plugin But how do I actually unset all of the select boxes for pages - not sure what it means


Widget "Save" resetting jQuery hidden fields

I have a widget plugin that I've created, that lists about 10 fieldsets. jQuery runs at the beginning and hides and fieldsets that have no values. There are also buttons that allow to "Add" and "Remove" fieldsets. Everything works great except for when its time to "Save". After clicking Save all of the jQuery stops working, all of the hidden fieldsets are shown, and the "Add" and "Remove" buttons no longer work. The only way to continue using the widget properly is to refresh the page Anyone idea what might be causing this, or a possible solution?


greatest() function returns undefined property

I'm using the mysql GREATEST() function to compare two table fields and display in a loop either one with the highest integer value. The 2 fields consist of vote scores for posts: UP or DOWN.               function vote_results($post_id) {        global $wpdb;        $table = $wpdb->prefix . "post_votes";           $results = $wpdb->get_row( "SELECT GREATEST (up, down) FROM $table WHERE voted_post_id = $post_id" );       echo $results->up; //echo if highest value       echo $results->down; //echo if highest value          }      Then in my loop I call the function but get `Notice: Undefined property: stdClass::$up` for               echo $results->up;      and the same notice for `down`. I'm not sure what I'm doing wrong here.


Allowing a user to write a post from another website?

The idea here is to have a site (any site) which somehow has the user's WordPress user-name and login (maybe as part of a sister site) to allow him to write a post on his own blog. The idea I have now is basically a simple form sent (perhaps with curl or socket) to the user's blog admin_ajax.php, even though it is strictly not an AJAX call. Are there any other methods which I could try or is there something built into WordPress itself already?


Slow Query for the wp_options table

I have been tracking the slow queries log of the WP based site (with the default value of the a long_query_time set to 10), and I have noticed that the following query is often getting logged -               # User@Host: root[root] @ localhost []     # Query_time: 0  Lock_time: 0  Rows_sent: 394  Rows_examined: 458     SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';      I do not understand how such a small table can take so much time to execute. Is this just a symptom of some other problem? (Currently running Moodle, phpbb and WP on a dedicated VM).


Walker for menus

I want to modify all of my `<li>`'s `class`es and `id`s, but the function `wp_nav_menu()` does not let me do so, so I think I need to use a walker. I am pretty new in OO, so using an object is not really easy. I'm pretty sure I need to extend `Walker` class (or `Walker_Nav_Menu` class?), but I'm not sure what method to override/implement. What method of my object is being called when I pass it as an argument in `wp_nav_menu( array( 'walker' => new myWalker ) )`? I do not want to do this with filters and actions because I find it cleaner with walkers.


Cannot install plugins even though www-data has write permissions

All the files in my WordPress path are owned by `myuser:www-data` and Apache is running as www-data. All files and folders have group write permissions, e.g. `-rw-rw----`, but I keep being prompted for FTP details when I try to install a plugin. If I chown the path to the www-data user, plugin installation and deletion work as expected, but then _myuser_ cannot edit files. I could add _myuser_ to the _www-data_ group, but then _myuser_ could access all other sites. My files are chown'ed as follows:               chown -R myuser:www-data wordpress-folder/*      And chmod'ed as follows:               find wordpress-folder/ -type d -exec chmod 755 {} \;     find wordpress-folder/ -type f -exec chmod 644 {} \;      If my files are owned by the www-data group and are group-writable, then surely WordPress should be able to install plugins. Why can't WordPress install plugins? Here is the output of `ls -la` in my plugins folder:               total 48     drwxrwx---  9 myuser www-data 4096 Aug  5 01:26 .     drwxrwx---  6 myuser www-data 4096 Aug  5 01:51 ..     drwxrwx---  6 myuser www-data 4096 Jul 10 16:27 disqus-comment-system     -rw-rw----  1 myuser www-data 6148 Jul 10 15:37 .DS_Store     drwxrwx---  7 myuser www-data 4096 Jul 10 16:30 gravityforms     -rw-rw----  1 myuser www-data   30 Jul 10 15:37 index.php     drwxrwx---  3 myuser www-data 4096 Jul 10 16:30 lime-export     drwxrwx---  6 myuser www-data 4096 Aug  1 11:17 mp6     drwxrwx---  6 myuser www-data 4096 Aug  5 01:26 rewrite     drwxrwx--- 10 myuser www-data 4096 Jul 10 16:38 wordpress-seo     drwxrwx---  7 myuser www-data 4096 Jul 24 17:14 wp-minify