title: How can I exclude tags from category_rss function?

text: I have been struggling with the following problem: The default wordpress RSS Feed includes also tags in category function. As a result, if you use a merge tag to show the post category (i.e. I am using RSS campaign on Mailchimp to send emails to my subscribers) it shows the category and in addition all the tags. I looked around and located the file '/wp-includes/feed.php' on line #301 there's the relevant code. I am including it here as well:               function get_the_category_rss($type = null) {         if ( empty($type) )             $type = get_default_feed();         $categories = get_the_category();         $tags = get_the_tags();         $the_list = '';         $cat_names = array();              $filter = 'rss';         if ( 'atom' == $type )             $filter = 'raw';              if ( !empty($categories) ) foreach ( (array) $categories as $category ) {             $cat_names[] = sanitize_term_field('name', $category->name, $category->term_id, 'category', $filter);         }              if ( !empty($tags) ) foreach ( (array) $tags as $tag ) {             $cat_names[] = sanitize_term_field('name', $tag->name, $tag->term_id, 'post_tag', $filter);         }              $cat_names = array_unique($cat_names);              foreach ( $cat_names as $cat_name ) {             if ( 'rdf' == $type )                 $the_list .= "\t\t<dc:subject><![CDATA[$cat_name]]></dc:subject>\n";             elseif ( 'atom' == $type )                 $the_list .= sprintf( '<category scheme="%1$s" term="%2$s" />', esc_attr( apply_filters( 'get_bloginfo_rss', get_bloginfo( 'url' ) ) ), esc_attr( $cat_name ) );             else                 $the_list .= "\t\t<category><![CDATA[" . @html_entity_decode( $cat_name, ENT_COMPAT, get_option('blog_charset') ) . "]]></category>\n";         }              return apply_filters('the_category_rss', $the_list, $type);     }      I understand that I can fix the problem by deleting the following lines:               $tags = get_the_tags();      and                   if ( !empty($tags) ) foreach ( (array) $tags as $tag ) {                 $cat_names[] = sanitize_term_field('name', $tag->name, $tag->term_id, 'post_tag', $filter);     }      I don't want to edit core files though. I also tried to find a plugin, but no luck. Is there a filter I could use to resolve this in order to avoid editing core files? Thank you in advance for any help! Kat


title: WP Query Exclude and Start by Menu Order Offset

text: I have a set of posts in a custom post type that I have given menu order attributes to. I am hoping to use `wp_query` to query the first 3 by menu order, then the next 3 by menu order. For example - If I have a list of posts given the menu order attribute of 1,2,3 -                  $args = array(                      'post_type' => 'my-post-type',                      'posts_per_page' => 3,                     'order_by' => 'menu_order',                     'order' => 'ASC'                 );         $loop = new WP_Query( $args );         while ( $loop->have_posts() ) : $loop->the_post();      How can I perform another query like this but start on the 4th post based on its menu order so I get 4,5,6? I figure I can use `post__not_in` and put their specific IDs, but I'd like to keep this dynamic and address the `menu_order` only.


title: Update a Wordpress post or page takes 60+ seconds

text: Since updating to Wordpress 3.5 I've had my updates of pages and posts become excessively slow. I've been timing them and they take 40-80 seconds to update. I've spent the last 2 hours reading and trying everything I can find in the Wordpress.org forums yet nothing works. I use maxcdn and CloudFlare for the frontside but the backside is unbearable. I am on a MU install using 3.5.2 and I have disabled and tested each plugin. Seems to be a Wordpress issue and I'm looking for a workaround. I'm on dual core VPS with 3GB of ram.


title: Submit form stored in one plugin from another plugin?

text: I have two plugins `pluginA` and `pluginB`. `PluginA` contains a form with a single button which when pressed will do some calculations. `PluginA` works fine, however, I want to be able to submit this form remotely from different plugin within the same website (both plugins are resided in same website) I did some investigation and found `wp_remote_request` can make remote request. I tried to use it with basic `url` to plugin page that contains form but it returns content to login. Apparently it needs to contain login credentials within request header. Any idea how can I achieve remote form submission? **CODE**               $url = site_url('wp-admin/tools.php?page=dt_documents_tagging_menu&remotely_sumbitted=true');     $args = array( 'method'=>'GET' );     $result = wp_remote_request( $url, $args );      `$result` when print_r return login form


title: Fire query on ajax post url page

text: Here i am sending the ajax response to load_post.php page from my ajax call.I am getting response on load_post.php on load_post.php i have to fire word press query. I was try this but getting bellow error in response.when i add global $wpdb variable into load_post.php file               Parse error</b>:  syntax error, unexpected T_GLOBAL in <b>/home/skovianc/public_html/test/thefoodieclub.com/wp-content/plugins/woocommerce-booking/load_post.php      ajax code               var time=0;     jQuery("#time_slot").change(function()                                     {                                        time=time_slot.value;                                 $.post("'. plugins_url().'/woocommerce-booking/load_post.php",                                      {name: time},                                       function(response){                                       console.log(response);                                       }                                     );                                        });       post url file load_post.php code here i want fire wpdb query               <?php session_start();         echo $name= $_POST["name"];         file_put_contents("name.txt", $name)      //Query will be some thing like               global $wpdb;     echo $query = $wpdb->prepare( "SELECT start_date FROM {$wpdb->prefix}booking_history");                ?>      So how can fire query on ajax post url page load_post.php


title: How to add a privacy-checkbox in comment-template?

text:
i need to add a privacy-checkbox to the file comment-template.php. I created the checkbox and a paragraph and it looks fine, so far.               <input type="checkbox" name="privacy" value="privacy-key" class="privacyBox" aria-req="true">
Hiermit akzeptiere ich die Datenschutzbedingungen
      Now, i want to connect this checkbox with the submit-button, so that a user HAS to accept the privacy to comment on a post. Anyone with a clue how to do that? Or it there a plugin, which delivers this services?


title: How to get values from wordpress listings and use them in javascript array?

text: I'm trying to get values (latitude, longitude and an image) from the WordPress database and put it into a javascript array. Unfortunately I'm a newbie at Javascript and PHP! Here is the code I have so far: **getdata.php:**               <?php         require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-config.php' );         require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' );       ?>      **distance.php:**               <?php       include 'getdata.php';     ?>     <html>     <head>     <script  type="text/javascript">            <?php $args = array( 'post_type' => 'listing', 'p' => $post_id ); ?>       values = [ <?php                                 $listing_marker_loop = new WP_Query( $args );                                      while ( $listing_marker_loop->have_posts() ) : $listing_marker_loop->the_post();                                       $address = get_field('location');                                      global $post;                                 // load all 'categories' terms for the post                                      endwhile;       ?>];            alert(values[1]);          </script>     </head>     <body></body>     </html>      I'm trying to get it to give me an alert, so that I know I'm on the right track! Can someone tell me how to make this work?


title: Prevent subscribers to changing certain profile fields

text: Is there a way to prevent "subscribers" from editing specific fields in their profile, like email? I thought it would be simple enough, but I've read though quite a few posts about it around the web (including this one prevent users from changing their email address and this How do you make the email field on the profile page read only for subscribers?) and I have yet to find a solution that doesn't involve hacking the core code (not desirable imo) or just hiding/disabling the field by JS (which means someone could technically get past it in a number of ways). But since most, if not all, posts I've found are a few years old so I'm thinking maybe something has happened since? If it's not possible to prevent in a "pretty" way, are there any good alternatives? Can I prevent the "subscriber" user from accessing the profile at all and rather build a new form to let them change password? The reason for this is that the email address (and possibly one or two other fields) will identify the users in a third party system, so it must only be changed by an administrator who can change it in both places.


title: Wordpress Short code with additional parameter

text:
I am using twitter boostrap in my recent project . I want that the post or page content will split into columns. For doing this I am declaring several shortcode like this               function two_column($atts,$content=NULL){         return ('
'. $content .'
');     }     add_shortcode('two_column', 'two_column');          function three_column($atts,$content=NULL){         return ('
'. $content .'
');     }     add_shortcode('column', 'three_column');     function four_column($atts,$content=NULL){              return ('
'. $content .'
');     }     add_shortcode('four_column', 'four_column');      Now if I need to split content in , then I just need to this               [two_column]content in first column[/two_column]     [two_column]content in second column[/two_column]      and so on for three or four column But I want to make a short code like this [column count=2]Content [/column] , I will just change the value of count , and then content will automatically split .


title: Adding YouTube button to TinyMCE editor

text:
I found a code set to add a YouTube button to the WP tinyMCE editor that I am now trying to incorporate into a Thematic Child theme. The code already works in a non-Thematic theme however, when I add it to the child theme functions file and include the js, not only does it not add the YouTube button, it actually makes the whole TinyMCE kitchen sink disappear. Bummer! Is there some Thematic-specific variation in the function calls that I'm missing which might make this addition work? The project won't sink without it, but it would definitely be enhanced with it. See code below: Function Code               <?php     // Add these functions to your functions.php file          // add the shortcode handler for YouTube videos     function addYouTube($atts, $content = null) {     extract(shortcode_atts(array( "id" => '' ), $atts));     return '
Watch the video
';     }     add_shortcode('youtube', 'addYouTube');          function add_youtube_button() {     // Don't bother doing this stuff if the current user lacks permissions     if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )     return;          // Add only in Rich Editor mode     if ( get_user_option('rich_editing') == 'true') {     add_filter("mce_external_plugins", "add_youtube_tinymce_plugin");     add_filter('mce_buttons', 'register_youtube_button');     }     }          function register_youtube_button($buttons) {     array_push($buttons, "|", "youryoutube");     return $buttons;     }          // Load the TinyMCE plugin : editor_plugin.js (wp2.5)     function add_youtube_tinymce_plugin($plugin_array) {     $plugin_array['youryoutube'] = get_bloginfo('template_url').'/editor_plugin.js';     return $plugin_array;     }          function my_refresh_mce($ver) {     $ver += 3;     return $ver;     }          // init process for button control     add_filter( 'tiny_mce_version', 'my_refresh_mce');     add_action('init', 'add_youtube_button');     ?>      javascript               (function() {     tinymce.create('tinymce.plugins.YourYouTube', {     init : function(ed, url) {     ed.addButton('youryoutube', {     title : 'youryoutube.youtube',     image : url+'/youtube.png',     onclick : function() {     idPattern = /(?:(?:[^v]+)+v.)?([^&=]{11})(?=&|$)/;     var vidId = prompt("YouTube Video", "Enter the id or url for your video");     var m = idPattern.exec(vidId);     if (m != null && m != 'undefined')     ed.execCommand('mceInsertContent', false, '[youtube id="'+m[1]+'"]');     }     });     },     createControl : function(n, cm) {     return null;     },     getInfo : function() {     return {     longname : "YouTube Shortcode",     author : 'Brett Terpstra',     authorurl : 'http://brettterpstra.com/',     infourl : 'http://brettterpstra.com/',     version : "1.0"     };     }     });     tinymce.PluginManager.add('youryoutube', tinymce.plugins.YourYouTube);     })();      Any help would be appreciated.


title: CSS is not loaded on mobile devices

text: I used w3 total cache on my Multisite install. For a reason I didn't understand, I was hacked, and when someone was going to one of the website, the visitor was redirected to porn websites. Only on mobile devices, not on standard computers. I removed w3 total cache, deleted the cache folder, etc. and the bad redirections disappeared. However, now, when someone is visiting one of the websites, the content is correct but the CSS is not loaded. So the websites look ugly. Did I miss to clean something after w3 total cache removal ? You can have a look at the problem on at http://libre-factory.com


title: Custom Post Type to Upload Images

text: I'm wanting to create a custom post type that can upload 2 images to display on the home page of a website. How would I attempt this? The images needs to be displayed underneath each other. Thanks!


title: Rate voting plugin

text: Is there a plugin that can let the readers vote? It's for something exactly like this: http://www.marca.com/debate/2012/05/2408/prevotaciones2408.html The thing is that every player could get an average note from the fans. Thank you.


title: Custom headers for the WordPress plugin directory

text: I just have submitted one of my simple WP Widget to the Wordpress Directory. http://wordpress.org/extend/plugins/wp-twitter-trends/ I want to add Plugin Title Image as like in http://wordpress.org/extend/plugins/contact-form-7/ How can I add that? From readme.txt file? How?


title: TinyMCE Editor removing <p> and <br> and putting   instead

text: Steps for problem reproduction:   1. Open WordPress Admin Dashboard (I use version 3.7);   2. Click on Page > Add Page;   3. On the editor, choose the "HTML" Tab;   4. Write `<p>Lorem ipsum dolor sit amet</p><br>` on the content area;   5. Choose the "Visual" Tab;   6. Choose "HTML" Tab back;   7. The code `<p>Lorem ipsum dolor sit amet</p><br>` lost its formatting and appears as:              Lorem ipsum dolor sit amet                 How to deactivate this TinyMCE issue to maintain the entirely original formatting? (I'm looking for a solution on JavaScript client-side of the editor)


title: Custom Taxonomy for specific pages

text: Hello the below code registers a taxonomy and causes the meta box to show only when in that taxonomy in the wordpress admin. My question is how to register a new taxonomy but have it only display for the children of a certain parent page. So if I had product type A, I would want all those child pages(products) to have the taxonomy and a meta box. The line that has                   'landing_pages',      places this in my custom post type in the admin. Another question is there a way to set an array so I can target post, page and a CPT? Curios how flexible the wordpress taxonomies are. Let me know if I am not being clear.                   /*  Landing Pages Categories Taxonomy  */                 add_action( 'init', 'landing_pages_cats' );                 function landing_pages_cats() { // Landing Pages Categories                      register_taxonomy(                           'landingpagescats',                           'landing_pages',                           array('label' => __( 'Landing Pages Categories' ), 'sort' => true, 'args' => array( 'orderby' => 'term_order' ), 'rewrite' => array( 'slug' => 'category-news-room' ), 'hierarchical' => true )                      );                 }


title: metaWeblog.getRecentPosts is returning nothing in my iphone app

text: **metaWeblog.getRecentPosts** is returning nothing in my iphone app, follwong is my objective c code to call that method,xml-rpc wordpress methods like **wp.getUsers** are working fine, but the methods which are used retrive commets,posts( **wp.getComments** , **metaWeblog.getRecentPosts** ) are returning null               NSArray *arrParameters = [NSArray arrayWithObjects:@"1", @"username", @"password", nil];         NSString *strServer = [[[NSString alloc] initWithString:@"http://abc.com/xmlrpc.php"] autorelease];         // the server         NSString *strMethod = [[[NSString alloc] initWithString:@"metaWeblog.getRecentPosts"] autorelease];                        // the method         XMLRPCRequest *objXMLRPCRequest = [[XMLRPCRequest alloc] initWithHost:[NSURL URLWithString:strServer]];         [objXMLRPCRequest setMethod:strMethod withObjects:arrParameters];      how can i resolve this,,,? is there any method to list the comments


title: Wordpress and Conditions

text:
this might sound stupid to most dudes around, but, I have this code:               <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>     <?php if ( in_category('123') ) { ?>

<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

     <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('pdfs'); ?>
     <?php } else { ?>

<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

     <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('pdfs'); ?>
     <?php } ?>     <?php endwhile; else: ?>     <?php endif; ?>      The thing is, how to add another category, like if is category 1 then output, HTML, if 2 the next html, if 3, so on so on.. Thanks!


title: add_rewrite_rule and passing variables for custom post types

text: this is driving me crazy!! Scenario is... Custom post type let's call it "cpt_product" setup with the rewrite "products" Trying to use the add_rewrite_rule to create a friendly URL for meta details pertaining to the product. For example, this custom post type has 3 meta fields associated with each post (mt_details, mt_inventory, and mt_availability) Desired URL sequence is domain.com/products/product-name/details/ domain.com/products/product-name/inventory/ domain.com/products/product-name/availability/ This would allows access to a parameter on the front-end which would allow the highlight of that information. This is the closest I've gotten just need a little help please!                   add_action('init','yoursite_init');     function yoursite_init() {       global $wp,$wp_rewrite;       $wp->add_query_var('metahighlight');       $wp_rewrite->add_rule('product/([^/]+)/details',     'index.php?metahighlight=details&post_type=cpt_product&name=$matches[1]', 'top');            // Once you get working, remove this next line       $wp_rewrite->flush_rules(false);       }      I did use this method although it didn't seem to help me... just trying to get a single one of these nice url's working. When I access the URL: www.sitename.com/index.php?metahighlight=details&post_type=cpt_product&name=product- name Wordpress returns www.sitename.com/products/product- name/?metahighlight=details&post_type=cpt_product When what I'm looking for is www.sitename.com/products/product-name/details/ Any suggestions would be greatly appreciated.


title: Wordpress, page 2 shows the same posts as page 1

text: I am working on a premium that got it's frontpage as a 'grid' here's what it looked like http://i.stack.imgur.com/Y392U.png Then i installed a plugin named: Blog Layout by WebLumia Infomatics to make my frontpage show up as a 'normal blog' and it now looks like this http://i.stack.imgur.com/qYBzG.png which is perfect. But when i click to page 2 to see more posts, it just shows the the same as on page 1 I am not really sure what to change in the plugin code but im hoping some guys here could help me. I already have an idéa where the change has to be made but im not sure at all. Here's what some of the code look like               switch( $this->type ) {     case 'multipart':         // Multipart page         $posts_per_page = 1;         $paged = max( 1, absint( get_query_var( 'page' ) ) );         $total_pages = max( 1, $numpages );         break;     case 'users':         // WP_User_Query         $posts_per_page = $query->query_vars['number'];         $paged = max( 1, floor( $query->query_vars['offset'] / $posts_per_page ) + 1 );         $total_pages = max( 1, ceil( $query->total_users / $posts_per_page ) );         break;     default:         // WP_Query         $posts_per_page = intval( $query->get( 'posts_per_page' ) );         $paged = max( 1, absint( $query->get( 'paged' ) ) );         $total_pages = max( 1, absint( $query->max_num_pages ) );         break;     }


title: How to Register/Link to .js Files in WordPress Dynamicaly in Header.php

text: Can you please let me know how I can dynamically register/link to my js files in wordpress? I have two js files as below code but I do not know how to map to them uring the `bloginfo()` as it is taking parameters!                <!--[if lt IE 9]>           <script src="assets/js/html5shiv.js"></script>           <script src="assets/js/respond.min.js"></script>      <![endif]-->      Thanks


title: Change "Thumbnail", "Medium" and "Large" image sizes using functions.php?

text: Right now I'm using `add_image_size` to create the thumbnail sizes needed for my theme, completely bypassing the options in Settings > Media since I can't depend on users to enter the correct values manually. However, that means WordPress is creating files for each of those sizes which will never be used. Is there any more efficient approach that would just allow me to override the default values in functions.php instead of creating new ones?


title: Show recent posts starting at a specific number archive

text: Is there an argument to define how many posts ago will be displayed in "recent" posts. Could I add something to this and define a specific number of posts ago to start the loop?               $args = array( 'numberposts' => '5' );     $recent_posts = wp_get_recent_posts( $args );      So for example I have a page of archives with their excerpts for the last 5 posts. In the sidebar I would like to show other posts from that category, starting with 6 posts ago.


title: How to embed .mp4 videos in a WordPress post?

text: I want to embed a video that was converted to mp4 from wmv, using ffmpeg. The video of course plays fine in VLC. However, it's being quite a pain to embed it in a WP post. I've tried using a variety of plugins -   1. Simple Flash Video - This plugin almost works. The thumbnail of the video is shown, and on click a ShadowBox appears with the JW Player loading the video inside. However, thats as far as it goes - the video never begins playing. The important thing here is, my download manager - FlashGet - shows that it can intercept the video being loaded. This means that at least the correct video URL is used here.   2. Flash Video Player - doesnt respond at all.   3. FLxER Player. Any pointers here ?


title: wp_create_user not properly entering password

text: I'm trying to create a new user after someone fills out a form. I'm using `wp_create_user` to do so. A user is being created properly, but, for whatever reason, no password is being submitted to the `users` table. It's simply a blank value. First of all, I should note that, unfortunately, for this project I'm on 3.1.3 and there is very little chance that I'd be able to use 3.2.1. I've checked to make sure that the password is correct up to the point that it is passed to the `wp_create_user` function and the value is as expected. I've also gone so far as to trace the password to the `wp_insert_user` function. It passes through the `wp_hash_password` function and comes out as a 34 character password hash. I then checked to see what the value of the password is before the `$wpdb->insert` method is executed to insert the user. The password is still the beautiful hash, not an empty value. I then kept on down the rabbit whole into the `_insert_replace_helper` method of the `$wpdb` class. The data fed to that function was just fine; however, the function returns:               return $this->query( $this->prepare( $sql, $data ) );      I went to look at the `prepare` method and it is defined as:               function prepare( $query = null ) { // ( $query, *$args )      Yes that little comment is from the actual code. When I saw it, I thought the previous dev had made this alteration. I was initially furious until I diffed it against the real file and found it to be identical. So, my confusion here is that the `_insert_replace_helper` method is calling the `prepare` method and sending it two arguments when it expects 1. What in the world is going on here? Ultimately, I have two questions: 1) Why isn't my password being sent to the database 2) What is going on with the `_insert_replace_helper` method sending two arguments to the `prepare` method? I should note that the function I'm using to add the user looks like:               // Function for registering user     function gov_register_user($name, $password, $email, $company, $phone)     {         // If user is registered, don't register him/her again, but return true so no error is flagged         if(email_exists($email))             return true;              // If any of the necessary fields are not filled, return false         if($name == '' || $password == '' || $email == '')             return false;              // It's now safe to register the user         $user_id = wp_create_user($name, $password, $email);         if($user_id)         {             // Email user             add_filter('wp_mail_content_type',create_function('', 'return "text/html"; '));             wp_mail($email, 'Registration', get_mail_user_registration($name, $email));                  // Set meta fields             set_cimyFieldValue($user_id, 'COMPANY', $company);             set_cimyFieldValue($user_id, 'PHONE', $phone);                  // Log user in             $gov_creds = array(                 'user_login' => $name,                 'user_password' => $password,                 'remember' => true             );             wp_signon($gov_creds, false);                     return true;         }         else             return false;     }


title: Display last comments on home page

text: Is there a way to select and display the last X approved comments regardless of which posts or categories they belong to ? I just want to show on my home page the last comments added on my site, but I can't find anywhere how to do that.


title: How does one go about converting custom post type to post format?

text: I have a blog which uses custom post type 'aside' for aside posts. Now that wordpress has custom post formats, I want to use the 'aside' post format instead. Is there a way to convert post typess to post formats? I'm looking for code/tool similar to wordpress's in-built tool which lets one convert from categories to tags.


title: Transient caching for wp query

text: I read about transient in the codex and some questions and answers here. So i'm developing a web app based on wp. It works now, but i want to optimize it. Users manage content regulary, so crud operations is common. Due to this i don't want to use page caching with expirations. I want to implement some caching functions on "get" operations. This is in my mind:   1. a user add some content, populate a list   2. i create a transient "record" for that list object, and for the item itself   3. when the list changes (update, delete, create) i delete the previous cache record and add the new one Mainly i use WP_Query (posts and meta). Questions: **Do i need this caching method, or using transient cache with wp_query won't take a large effet?** **My other concern to put all results into another table feel a bit irrelevant..?!**


title: What is the function to check network admin?

text: I know there is a function to check normal admin area. Its `is_admin()` Is there any other function available to chevk network admin something like `is_network_admin()` ? Thanks


title: Get latest author posts inside the loop

text:
I have a wordpress theme which needs to retrieve the latest 3 author posts which is simply straight forward but I have ran into a sticky problem. Because I am calling this from already within the:               if ( have_posts() ) : while ( have_posts() ) :the_post();     endwhile; endif;      For some reason it's not working. Here is the code I have used:               if ( have_posts() ) : while ( have_posts() ) :the_post();          //some content goes here regarding the post itself!!!     //some content goes here regarding the post itself!!!     //some content goes here regarding the post itself!!!     //some content goes here regarding the post itself!!!     //some content goes here regarding the post itself!!!     //some content goes here regarding the post itself!!!     //some content goes here regarding the post itself!!!     //some content goes here regarding the post itself!!!     //some content goes here regarding the post itself!!!          $relatedargs = array(          'author_name' => get_the_author(),     'post__not_in' => array( $post->ID),     'posts_per_page' => 3          );          $relatedquery = new WP_Query( $relatedargs );          while($relatedquery->have_posts()){ $relatedquery->the_post();           ?>
          <?php     if(has_post_thumbnail()) {      $relatedthumbnail = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'medium', false);     $relatedthumbnail_large = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full', false);     ?>
<a href="<?php echo $relatedthumbnail_large['0']; ?>" rel="prettyPhoto"><img src="<?php echo $relatedthumbnail['0']; ?>" alt="<?php the_title(); ?>" />
          <?php } ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
 <?php echo get_the_time('j') . '/' . get_the_time('m') . '/' . get_the_time('Y') . ' '; ?>  <a href="<?php the_permalink(); ?>"> <?php comments_number(0 . __(' comments','textdomain'), 1 . __(' comment','textdomain'), '% ' . __('comments','textdomain')); ?>

          <?php } wp_reset_postdata(); ?>          endwhile; endif;      It works 100% on my local page but when I upload to the server it just does not show anything, I get no errors whatsoever, I'm on debug mode.


title: Show or hide lang="ur" in main <body> element

text: I have RTL website in URDU language. `lang="ur"` is hard coded in main body i.e. `<body lang="ur" <?php body_class(); ?>>`. Now I want to replace attribute with some PHP code that will show or hide it on specific conditions. I want that on page editing screen, there will radio buttons. When we select "Remove", remove `lang="ur"` from current page & otherwise leave it remain.


title: Calculation for each custom post type

text:
I have a code looking like something like this: (It calculates number of registered members for each course)               foreach($courses as $course) {              global $wpdb;                 $sql = "SELECT COUNT(*) FROM $wpdb->usermeta";                 $sql .= " WHERE meta_key = '%s' and meta_value=1";                     $registered_count_course = $wpdb->get_var($wpdb->prepare( $sql, $course));                 echo 'Registered for course ' . $course . ' = ' . $registered_count_course . '
';           }      where `$courses` are a custom post-type called 'course'. Above works, but how do I this more effectively with a join? I don't know which tables I should join?


title: Enqueue scripts based on options

text: What is the best method to enqueue scripts based on options I have? Let's say I have 50 options and for each I need to enqueue a script(some of them might repeat.). Can I have any problems(performance, etc.) if I do this in a `foreach` loop and `switch` to detect what script I need? Do you think is better than calling all scripts no matter what options I have? Like so(the class works just like I need):               <?php     class MyClass{         var $options;              public function __construct($options){             $this->options = ( isset($options) ) ? $options : array();             add_action( 'admin_enqueue_scripts', array(&$this, 'enqueue') );         }              //This is the section where I enqueue the scripts         function enqueue() {             foreach ($this->options as $value) {                 switch ($value['type']) {                     case 'value1':                         wp_enqueue_script('value1_script');                         break;                     case 'value2':                         wp_enqueue_script('value2_script');                         break;                 }             }         }              function render_opts() {             $output = '';             foreach ($this->options as $value) {                 switch ($value['type']) {                     case 'value1':                         $output .= 'value1';                         break;                     case 'value2':                         $output .= 'value2';                         break;                 }             }             return $output;         }     }


title: preg_replace and comment_form_defaults

text: this was kinda of a joke at the beginning but now I'm wondering if it's possible to use regex with the hook comment_form_defaults. Here is what I'm looking for :               function remove_default_allowed_tags( $defaults) {         $defaults = preg_replace('/<p class="form-allowed-tags">(.*?)<\/p>/','', $defaults);         return $defaults;     }     add_filter('comment_form_defaults', 'remove_default_allowed_tags', 2);      I know it can be easily done with something like this : `$defaults['comment_notes_after'] = ''; return $defaults;` But I just want to know if I can use my regex in this context and if not, why. Thanks for your answer(s).


title: wp_mail: An array as $to - multiple emails or single email with all the email ids in it?

text: If I will use an array of email IDs for $to parameter of wp_mail function, will it send different emails to all those email ids or will send one email with all the email ids as 'to'?


title: Add relevant tag to search results

text:
Tags are a major part of my platform. Using the default search, **if** the search term matches a tag, on the results page, I want it to display:
Are you looking for our TAG-Name page?
      The tag must have at least one post attached to it, so no empty tags. What would be the _lightest_ solution to achieve this? Our search feature is used very frequently.


title: Troubleshooting a "You do not have sufficient permissions to access this page" error

text: I have a multisite installation running WP 3.5. My main site and a few other blogs on the network work fine. However, if I register a new user and site, that user gets the "You do not have sufficient permissions to access this page." error any time they try to visit the admin panel of the site. The front end of the site works properly. When I look at the user in the Network Admin interface, they are shown to be an admin of that site. If I add the Network Admin to the site, I can view the admin area. I've tried the usual suggestions of disabling and removing all plugins, activating the Twenty Twelve theme and reinstalling the WP core. None of these work. How can I fix this?


title: Extra title output with this function wp_list_pages

text:
here is the code :               add_shortcode ('get_menu_child','get_menu_child');        function get_menu_child ($att) {                 global $wp_query;            $thePostID = $wp_query->post->ID;                 $output = '';            $output .= '
';            $output .= wp_list_pages("echo=0&child_of=5&exclude=".$thePostID."");            $output .= '
';              return do_shortcode($output);        }       here is the output :

Pages

Culte et culture

Écoles

Organismes communautaires

Parcs et camping

Tourisme

      Question why the function return a "extra" pages text "PAGES" how to get rid of it ?


title: How does filter the_posts work?

text: I don't want to display post with empty body / post_content on my home page. So I added below code to my function.php. It detects post with empty body but it still display them. I expected that if I return '' the post won't be displayed.   * How can I **remove** post from displaying?   * How does the **filter the_posts work**? The code:               function remove_post_with_empty_body ( $posts ) {              if (($posts->post_content) == '') {                        echo 'empty'; //also tried return false; and return null;                  return '';         }         else {                  echo 'not empty';             return $posts;         }          }     add_action('the_post', 'remove_post_with_empty_body');


title: Add text to post list/edit screens?

text: I'd like to add some descriptive text underneath the page title on both the list and edit post screens for the default post and also custom post types - e.g. "Below is a list of your recent blog posts." What's the best way to do this?


title: How to know the theme name of a wordpress blog?

text: I visit http://ltty.wordpress.com/ and want to know the theme name (so that I can use :) for my blog). How can I get it?


title: How to display conditional-content if wp_nav_menu( $args ) retruns something

text: I have a sidebar that displays child links of the current page (using this solotuin by http://wordpress.stackexchange.com/a/2809/27414) which works perfectly. If there is child links to be displayed in the side bar I would like to give it a heading such as "Also is this section". I have tried the following which didn't work:               if (wp_nav_menu( $args )){         echo "Also in this section";     }      Thanks


title: the_post_thumbnail issues

text:
I am trying to make the thumbnail for each post display on the homepage of a site for a client; although the thumbnails do display, they're not being displayed inside of a specified "thumbnail" div and i cannot figure out why. You can see the issue yourself here; http://roswell.n8geeks.com. As you can see, the thumbnails are being displayed at the top of the article but should be displayed inside the thumbnail div. **The code**               function Last5posts()   {         $args = array( 'posts_per_page' => 5, 'cat' => '3');                           $last_5_posts_query = new WP_Query( $args );         while($last_5_posts_query->have_posts()) :              $last_5_posts_query->the_post();             $link = get_permalink();             $title = get_the_title();             $date = get_the_date();                                                $content .= '
';             $content .= '
' .the_post_thumbnail("home-post-thumbnail"). '
';             $content .= '
'.$title.' / '.$date. '
';             $content .= '
' .get_the_excerpt(). '
';             $content .= '
';         endwhile;          return $content;     }          add_shortcode('Last5Posts', 'Last5posts' );      Help is greatly appreciated.


title: posts_per_page option limits the number of Gallery items

text: I have noticed that if I have a query where posts_per_page are set to 4, any (image) gallery that belongs to one of those posts will too have only 4 items (although when I create the gallery from Add new post the gallery has 10 images). How can I fix this?


title: Moving local wordpress page to a real server subdomain broke my permalinks?

text: I developed a site locally with `/%postname%/` permalink structure. I did some sample posts locally and wanted to move this entire local setup to a temporary subdomain like http://review.clientsite.com. 1.) I exported the local sql table and imported it on the real database 2.) I changed the two fields inside the `wp-options` table to fit the new url `http://review.clientside.com` 3.) I uploaded all files to the real server and got rid of the "wp-config.php" and installed wordpress on the real server. 4.) If I launch http://review.clientside.com I see the site running and everything seems to work just fine. The stylesheets, the js, everything. However only thing that does not work are my permalinks! Every link ends in a 404 -> e.g. http://review.clientside.com/projects I also copied the .htaccess file from my local server to the real one. I even tried dropping the entire "permalinks" field in the wp-options table and reset the permalink-structure in the permalink settings inside wp. Any ideas on that matter?


title: Use ajax request to load sidebar

text: For a project, i've to improve SEO perf and one of this optimization is to load the sidebar with an ajax request. I've looking for this solution through the documentation, source code, plugins repository without success. So i need your help and advices. Is it possible to do this ? If yes, what is the best way ? Thanks.


title: What is considered the post's creation date for wp_insert_post?

text: I have the following hook which sets a default "hotness" for a post. For context, hotness is a `meta_value` saved to the post, and changes every time someone upvotes or downvotes the post. I use this `meta_value` to sort posts on a 'What is hot right now?' page. Because at the time the post is created in WordPress, the "score" of upvotes vs. downvotes is 0. Therefore I can completely omit the score's portion of the hotness calculation. When the post is created, only the creation time is taken into account:               /* Hook: Add custom postmeta when a new post is created      * Since: 8.0      */     add_action( 'wp_insert_post', tjnz_prepare_postmeta );     function tjnz_prepare_postmeta( $post_id ) {         if ( !wp_is_post_revision( $post_id ) ) {             $hotness = round( ( time() - 1211380200 ) / 800000, 7 );             add_post_meta( $post_id, '_tjnz_favorites', 0, true );             add_post_meta( $post_id, '_tjnz_plays', 0, true );             add_post_meta( $post_id, '_tjnz_downloads', 0, true );             add_post_meta( $post_id, '_tjnz_upvotes', 0.000, true );             add_post_meta( $post_id, '_tjnz_downvotes', 0.000, true );             add_post_meta( $post_id, '_tjnz_hotness', $hotness, true );         }     }      I'm wondering what happens when you schedule a post in WordPress. Will the hook be triggered when I click `Schedule`, or when the WordPress cronjob publishes the post? If the hook is triggered when I click `Schedule`, how can I effectively change that so that the time inserted into the database is actually the post's publish time, rather than when I clicked to schedule the post? The Codex page for `wp_insert_post` states that the `$post` object has a `'post_date_gmt'` member. It's documented as: > `'post_date_gmt' => [ Y-m-d H:i:s ]` // The time post was made, in GMT. To me, it is unclear if they mean when it's inserted into the database (time of clicking the schedule button) or when it's 'meant' to be created (the time which I entered in the scheduler). Can someone please clarify this? # Edit: After examining ialocin's answer, I have concluded that my current usage of the wp_insert_post hook is not going to yield the desired results. I will try another approach, but want to clarify my intentions to help others understand why I need this. As I said earlier, I calculate a 'hotness' value for every post I make. Without the influence of a score, the hotness still gradually increases over time. At `Unix Epoch + 1211380200 seconds` is my 'personal site Epoch'. If a post's `post_date_gmt` = 1211380200, it is essentially posted at the 'birth' of my site (this is May 21st, 2008). For every new post, I want to save it's initial hotness value, so I have to know the post's publish date (in GMT Unix timestamp) and subtract the time different between Unix Epoch and my Epoch, which is 1211380200 seconds. When I post content, I often schedule multiple posts to go 'on air' throughout the week, because I don't have enough time to post every day. It is important that posts get the initial value right, because it is the basis for any further calculation. My new approach would be to hook into post status transitions. Please help me get this right:               add_action( 'transition_post_status', 'tjnz_prepare_postmeta', 10, 3 );     function tjnz_prepare_postmeta( $new_status, $old_status, $post ) {         if ( $new_status == 'publish' && $old_status != 'publish' ) {             $hotness = round( ( $post->post_date_gmt - 1211380200 ) / 800000, 7 );             update_post_meta( $post->ID, '_tjnz_favorites', 0 );             update_post_meta( $post->ID, '_tjnz_plays', 0 );             update_post_meta( $post->ID, '_tjnz_downloads', 0 );             update_post_meta( $post->ID, '_tjnz_upvotes', 0.000 );             update_post_meta( $post->ID, '_tjnz_downvotes', 0.000 );             update_post_meta( $post->ID, '_tjnz_hotness', $hotness );         }     }      The reason I also check for `$old_status` is because I am assuming that when I **update** an already published post, both `$new_status` and `$old_status` would be `'publish'`. I do **not** want to accidentally reset any of the meta values every time I update an existing published post. I also changed `add_post_meta` to `update_post_meta` because that way I can ensure the correct values are inserted into the database whether a post is Published directly or Scheduled. I believe if the meta values do not yet exist, `update_post_meta` will actually act as an `add_post_meta` function.


title: Meta query with multiple custom fields for archives page ordering problem

text: I'm modifying the query for archives pages so that the posts showing up on year, month or day pages are queried by there custom field (`start-date` and `end-date`) and are sorted by custom `star-date` field. Here's my code:               function display_posts_on_archive_pages( $query ) {         if( $query->is_main_query() && $query->is_archive && !is_admin() ) {                  $year = $query->query['year'];             $month = isset($query->query['monthnum']) ? $query->query['monthnum'] : NULL;             $day = isset($query->query['day']) ? $query->query['day'] : NULL;                  if($query->is_year){                 $value = array(mktime(0, 0, 0, 01, 01, $year), mktime(23, 59, 59, 12, 31, $year));                 $compare = 'BETWEEN';                  } else if($query->is_month){                 $next_month = sprintf("%02d",$month+1);                 $value = array(mktime(0, 0, 0, $month, 01, $year), mktime(0, 0, 0, $next_month, 01, $year));                 $compare = 'BETWEEN';                  } else if($query->is_day){                 $value = mktime(0, 0, 0, $month, $day, $year);                 $compare = '<=';                 $compare2 = '>=';             }                  $meta_query[] =                 array(                    'key' => 'if_events_startdate',                    'value' => $value,                    'compare' => $compare,                   );                  if($query->is_month){                 $meta_query[] =                     array(                        'key' => 'if_events_enddate',                        'value' => $value,                        'compare' => $compare,                       );                 $meta_query['relation'] = 'OR';             }                  if($query->is_day){                 $meta_query[] =                     array(                        'key' => 'if_events_enddate',                        'value' => $value,                        'compare' => $compare2                       );                 $meta_query['relation'] = 'AND';             }                  $query->set( 'year','' );             $query->set( 'monthnum', '' );             $query->set( 'day','' );         if(!$query->is_month){             $query->set( 'meta_key', 'if_events_startdate' );             $query->set( 'orderby', 'meta_value_num' );             $query->set( 'order', 'ASC' );         }             $query->set( 'posts_per_page', '10' );               $query->set( 'meta_query', $meta_query );         }     }     add_action( 'pre_get_posts', 'display_posts_on_archive_pages' );      For Year and Day pages everything is OK, but for Month pages the sorting won't work (that's why I've put the `if ( ! $query->is_month ) {` in the $query->set. At the end for month pages I have the right posts but without the start-date sorting. And if I delete the `if ( ! $query->is_month ) {` statement I get posts even if they are not included in the month queried (ex.: posts of September in August...) If anyone has a clue... didn't find my solution for the moment. Thanks


title: How to pass hook variable to function?

text: I have a function that has an add_action inside it that calls the user_register hook. I would like to be able to echo the variable $user_id from the user_register hook and the $_POST array as well. (Ok, my goal is to do more than that, but you get the idea). See below:               function my_function{          add_action( 'user_register' .....              .         .         .     echo $user_id;     var_dump ($_POST);         .         .         .     }      How might I accomplish this? I realize this is probably really simple but examples that I've seen haven't used an add_action inside another function. Thanks for any help.


title: Adding a captcha plugin for comments in the site

text: Hi, I am new to WordPress.I need to add captcha in my site just before the comments section. Wherever there is comments, I need to display the captcha. I do not have a form. How can I do it?


title: Exclude content from w3 total cache

text: I use w3 total cache on a site I run which also now has to display a small popup at the bottom of the page to mention that the site uses cookies (thanks EU). The idea is that this only appears the first time the user sees the page, a cookie is then set to make sure the site doesn't show this user the popup again. However W3 will often cache a version of the site with this popup visible meaning the popup is shown regardless of the cookie existing or not. The popup is drawn with a `<div>` at the bottom of each page and it is only drawn if the cookie is set. Essentially the question is, how can I exclude W3 cache from always showing this? Is this even possible, or is there an alternative to how this popup is shown that gets around this issue? Thanks.


title: Why is my select meta data not saving?

text: I am working on a site at the moment where I need to save several different types of meta data for a custom post type. At present I have a text input that is saving with no problem but am struggling to get a select field to do the same. This is the function that outputs the select field:               function kwi_department_input() {         // Define function to create meta box for team member department.              global $post;         echo '<input type="hidden" name="teammeta_noncename" id="teammeta_noncename" value="' . wp_create_nonce(plugin_basename(__FILE__)) . '" />';         $department = get_post_meta($post->ID, '_department', true); ?>              <select name="_department" id="_department">             <option value="Directors" <?php selected($department, 'Directors'); ?>>Directors</option>             <option value="Finance / Admin" <?php selected($department, 'Finance / Admin'); ?>>Finance / Admin</option>             <option value="Customer Service Team" <?php selected($department, 'Customer Service Team'); ?>>Customer Service Team</option>             <option value="Commercial Team" <?php selected($department, 'Commercial Team'); ?>>Commercial Team</option>         </select>     <?php }      And this is the function that saves all of the data:               function kwi_save_team_meta($post_id) {         if( !wp_verify_nonce( $_POST['teammeta_noncename'], plugin_basename(__FILE__) )) {             return $post_id;         }              if( !current_user_can( 'edit_post', $post_id ) ) {             return $post_id;         }              $team_meta = array(             '_department' => $_POST['_department'],              '_languages' => $_POST['_languages'] // Languages is the text input that is saving with no issue.         );              foreach($team_meta as $key => $value) {             if(get_post_meta($post_id, $key, FALSE)) {                 update_post_meta($post_id, $key, $value);             } else {                 add_post_meta($post_id, $key, $value);             }             if(!$value) {                 delete_post_meta($post_id, $key);             }         }     }      Any pointers as to what I'm doing wrong would be much appreciated.


title: Is there a way to fire other functions from wp_insert_post

text: I am creating a new post using the `wp_insert_post` function. Here's what that code looks like:               $new_post = array(                 'post_title' => $newtitle,                 'post_status' => 'publish',                 'post_content' => $repost[content],                 'post_excerpt' => $repost[excerpt],                 'post_author' => 1,                 'post_type' => 'post',                 'post_category' => explode(",",$catlist),              );                  wp_insert_post($new_post);      The post is created fine, but I'd like to fire some other functions, such as Jetpack's social posting tools (Publicize.) Is there code to do that or would I be better in changing the post_status to draft and setting a future publishing date?


title: How to show months in wordpress archive page?

text: I am a newbie to wordpress and have no knowledge of PHP. I want to show the months in my archive page, in this manner ![enter image description here](http://i.stack.imgur.com/xQcc4.png) where, it shows the starting month when i my first post was made and continues to shows all months and year, till the current month of the year. I want the months to be hyperlinks of this manner `http://bibhudutta.com/2014/3/` based on each month and year. Please help me out, how to do it in PHP and wordpress.


title: Currently using a query_posts() in my theme - want to use a request filter in stead

text: I am currently using this code in my theme right before showing the content of the custom post type my_post_type:               $title = $post->post_title;     query_posts( array (         'post_type' => 'page',          'posts_per_page' => -1,         'my_taxonomy' => $title         ));      This means that when I go to .../my_post_type/some_title, I see all pages that are assigned "some_title" as my_taxonomy. Now I want to do the same thing in a plugin in stead of a theme. This means is (I guess) that I have to use the "request" filter? I have tried to do this:               add_filter( 'request', 'alter_the_query' );     function alter_the_query( $request ) {         $request['post_type'] = 'page';         $request['my_taxonomy'] = 'some_title'; // just hardcoded so far while testing         $request['posts_per_page'] =  -1;         return $request;     }      But it doen't return any pages at all. Not even this works:               add_filter( 'request', 'alter_the_query' );     function alter_the_query( $request ) {         $request['post_type'] = 'page';         return $request;     }      What am I doing wrong, or how can I achieve the same thing as my with my call to query_posts()? Thanks a lot!


title: Moving wp-admin folder to a different host in a multisite environment

text: Current Multisite setup:   * First site: `www.site1.com`   * Second site: `subdomain.site1.com`   * Admin: `www.site1.com/wp-admin/` How to move wp-admin to a different host, which is accessed via a domain say `admin.site1.com`?


title: How to display all category images for single post in a page?

text:
Here is my code

Microsoft
     <?php foreach (get_the_category() as $cat) : ?>

<img src="<?php echo z_taxonomy_image_url($cat->term_id); ?>" />
     <?php echo $cat->cat_name; ?>
     <?php endforeach; ?>


title: How to extend the page editor?

text: I'm really a newbie to WordPress. I can edit the page via admin Page menu. There is a form submitted on that page. How can I write my own functions to handle this form submission?   In other words, how could WordPress recognize the route in form ACTION, and forward to my functions? Use a plugin?


title: Store loop into array

text: I am using folowing code to store posts ids into array:               <?php         $args = array(             'post_type' => 'product',             'post_status' => 'publish',             'ignore_sticky_posts'   => 1,             'posts_per_page' => 5,             'orderby' => 'date',             'order' => 'desc');     $id = array();     $counter = 1;            $products = new WP_Query( $args );     if ( $products->have_posts() ) : while ( $products->have_posts() ) : $products->the_post();         $id[$counter] = get_the_id();         //custom_shop_array_create($product, $counter);         $counter++;     endwhile;     endif;     ?>      However it doesnt work because if I put `print_r($id)` after endif it only prints id of last post. Where am I making mistake? Thanks in forward


title: Weird issue where form field loses focus to previous form field even with JS disabled

text: I've never seen a problem like this in my 12 years of working on the web. Even with Javascript disabled (in all browsers, with all users on different computers), a field that gets focus then loses it to the previous form field. I thought I had some rogue jQuery somewhere but couldn't find any... then decided to disable Javascript and see what happens. The same problem exists. What the deuce kind of wizardry is this?!? Attached is a link to a screencast demonstrating the issue. Note that the first bit shows the problem with JS enabled (as demonstrated by the presence of TinyMCE toolbar) and the second is without (as demonstrated WITHOUT TinyMCE). Help?! http://screencast.com/t/y2NfpGa8z


title: Don't show certain div on front page?

text: I have CSS issues with a certain div only on the front page (front-page.php). As I can't fix it, I was thinking about removing the item, but only on the front-page. I'm not exactly sure how I have to code this in Wordpress. I want this div in the Header to show up everywhere but on the front-page.php:               <!-- BEGIN TOP SEARCH -->          <form id="searchform" action="<?php bloginfo('url'); ?>/" method="get">                         <input type="submit" value="" id="searchsubmit"/>     <input type="text" class="field" name="s" id="s" value="Search or be lost" onfocus="this.value=''" />                          </form>                 </div>                 <!-- END TOP SEARCH -->      Is this possible?


title: Wordpress 3.3 auto update not working

text: I am at my wit's end! Trying to auto upgrade to Wordpress 3.3 and its not working. I have tried every trick I found on the net   1. The entire wordpress directory and all its sub directories has been given 0777    2. Somewhere I saw a tip about deleting the upgrade directory and trying again, BUT no upgrade directory is ever created. When I try to upgrade wordpress, I get so far as to WP asking me for FTP info, which I do provide (and it is 100% correct) and then when I hit next nothing happens. I just see a semi blank page with the left hand menus and nothing on the right hand side, the page just keeps loading and loading and loading. No error log is created, no error mesages are displayed on screen. I am going to pull out my hair in frustration. Please help.


title: Add qtranslate language select box to menu

text: I can't find any info on how to operate qtranslate and add the select box to change language to the right of my header navigation. Any ideas?


title: Recovering a wordpress blog that got corrupted

text: recently i had my blog up and running, but i installed some new software by accident and messed it up.i have reinstalled my word press, and i was wondering is there a way i can recover my old post? I really would like to be able to add them to my new installed word press blog. I tried to use MyAdminPHP but didn't have any idea how to look for the post and fine them.


title: Use specific language for comment section

text: On some pages I have the possibility to write a comment (name, email, website, comment). The labels are now in my default language. Now I want to use the English labels for the whole comment section. How can I reach this? I searched a little bit and found out that I can set some labels with               <?php comment_form(array('label_submit' => 'Submit comment' )); ?>       But then I would have to set each label and I don't know if I can find and catch all these labels. Are there other ways doing this? PS: The comments.php is from Twenty Eleven Theme and I'm using WPML.


title: Infinite Scroll on Self-hosted Wordpress

text: Trying to move a Wordpress website from Wordpress.com to a self-hosted version. http://onvegetables.com/ The site automatically had infinite scroll on Wordpress.com and I'm trying to implement that on the self-hosted version. Is that feature part of the JetPack plugin? If not does WordPress offer a way to simulate that functionality on self-hosted?


I'm trying to build a complex search form with filters for several custom taxonomies, a search terms input and a select for the number of items displayed / page. The question has been posted before over at Advanced search form with filters for custom taxonomies and custom fields and the answer provided by Brady was an excellent starting point. I'm going to try my best to explain the functionality, here's the page template source https://gist.github.com/a82329d519c93d35f1f3 Basically, I have the 'interview' custom type and 2 taxonomies 'interview- type' and 'interview-cat' which will have filters inside the form. There are actually 2 different forms, both containing search filters: #search- filters, which is the main one, and #type-filters, which only has 3 buttons for the 'custom-type' taxonomy values. Both of these forms work the way I want them to, but there are a couple of problems still: The biggest one is pagination: The function mytheme_page_navi is the same as the WP-PageNavi plugin, and the problem here is that as soon as I go to the second page, I lose all the filter values, and it displays posts from the 'written' 'interview-type', 10 posts / page ( which are the default values, for when the user first arrives on the page and hasn't selected any options yet. ) Why does this happen? Also, another problem is that because I have 2 forms, if I enter some values in the main one, and then select the 'interview-type' from the #type-filters, all the previous filter values are removed. In the end, I would be grateful if someone could take a quick look over the code and point out what I'm doing wrong. I've been trying to wrap my head around this for days with no luck.


title: Filter by one custom field, order by another?

text: I have a custom post type "Listing" and I want to get all Listings that have a custom field `gateway_value != 'Yes'`, and order the results by another custom field, `location_level1_value`. I can get the queries to work separately, but I can't combine them: # Query 1 (sort by location):                               $wp_query = new WP_Query( array (                         'post_type' => 'listing',                         'post_status' => 'publish',                         'posts_per_page' => '9',                         'meta_key' => 'location_level1_value',                         'orderby' => 'location_level1_value',                         'order' => 'ASC',                         'paged' => $paged                         )                      );      # Query 2 (custom field value != Yes):                               $wp_query = new WP_Query( array (                         'post_type' => 'listing',                         'posts_per_page' => '9',                         'post_status' => 'publish',                         'meta_key' => 'gateway_value',                         'meta_value' => 'Yes',                         'meta_compare' => '!=',                         'paged' => $paged                         )                     );      # Combined query: I looked at the codex for help with this, but the following query does not work:                               $wp_query = new WP_Query( array (                         'post_type' => 'listing',                         'posts_per_page' => '9',                         'post_status' => 'publish',                         'meta_query' => array(                             array(                                 'key' => 'gateway_value',                                 'value' => 'Yes',                                 'compare' => '!='                             ),                             array(                                 'key' => 'location_level1_value'                             )                         ),                         'orderby' => "location_level1_value",                         'order' => 'ASC',                         'paged' => $paged                         )                     );      What am I doing wrong with the combined query? [UPDATE]: So now that 3.1 has been released, the combined query above still does not work. I do get results, just not sorted correctly. [UPDATE]: `var_dump($wp_query->request)` gives the following:   `string(527) " SELECT SQL_CALC_FOUND_ROWS wp_7v1oev_posts.* FROM wp_7v1oev_posts INNER JOIN wp_7v1oev_postmeta ON (wp_7v1oev_posts.ID = wp_7v1oev_postmeta.post_id) INNER JOIN wp_7v1oev_postmeta AS mt1 ON (wp_7v1oev_posts.ID = mt1.post_id) WHERE 1=1 AND wp_7v1oev_posts.post_type = 'listing' AND (wp_7v1oev_posts.post_status = 'publish') AND wp_7v1oev_postmeta.meta_key = 'gateway_value' AND CAST(wp_7v1oev_postmeta.meta_value AS CHAR) != 'Yes' AND mt1.meta_key = 'location_level1_value' ORDER BY wp_7v1oev_posts.post_date DESC LIMIT 0, 9"`


title: Save_post for custom post type?

text: Is there a save_post hook for custom post types? example: save_my_post_type I know there is publish_my_post_type but I'm looking for a save hook.


title: How to cleanly delete attachment but retain original file?

text: `wp_delete_attachment()` is very comprehensive and wipes every trace of attachment from database and disk. Is there easy way to keep original file? Forking under another name is not an option, because other functions like `wp_delete_post()` will still call original version.


title: Import CSV to MySQL, with custom registration field information

text: I have to update the information of 1500 members of my clients Wordpress site. I'm using a membership to manage paidd subscriptions and I have to update the custom fields generated by this Plugin. I have looked in the MySQL database and found the following meta keys in the wp_usermeta table: paypal_user, paypal_status, paypal_custom_fields Pyapal_user and paypal_custom_fields have a several bits of information in each one that need updating. I know how to import to MySQL using a CSV, but I'm not too sure how to set the data out in the CSV file as I'm not to familiar with MySQL. Would anyone know? Thanks in advance.


title: Optimize post insert and delete for bulk operations?

text: Not much noticeable when working with individual posts, but when you create or delete multiple thousands in bulk and by code - process is quite slow. Are there any good tweaks to apply and corners to cut? Context:   * `wp_insert_post()` with categories and tags passed;   * add several custom fields;   * create and associate attachments (from existing files).


title: Custom post type name and url parent/child structure 404 issue

text: I'm having a conflict between the name of my custom post type and my url structure. I've got a custom post type called 'timber-frames'. The 'timber-frames' landing page uses a page template that displays all posts for the 'timber- frames' CPT. Essentially a custom archive using a page template. Example url: mysite.com/timber-frames (this shows all the posts from the 'timber-frames' CPT) I also have a custom taxonomy for the CPT, within which I have terms such as 'engineering', 'design', etc. I've set up custom archive pages for each of these terms as well, creating sub-sections under the 'timber-frames' parent. These each use separate page templates to allow my client to edit content on each page. Example url: mysite.com/timber-frames/engineering (this shows all the posts categorized as 'engineering' within the 'timber-frames' CPT) This is all well and good, but I get a 404 on the front end when trying to access the term archive pages. Tried resetting/flushing the permalinks, but it didn't work. The conflict appears to be that the parent page slug is the same as the slug of the CPT. Specifically, 'timber-frames'. When I make the names different from each other everything works fine, but I need the url structure to consistently show 'timber-frames' as the parent. I've been scouring the web for a solution but haven't come across anything that seems to do the trick. Any help is appreciated! \-- **UPDATE Aug 31 2013:** I may have made my original question too complicated. Essentially I've got a custom post type called 'timber-frames', which, for single posts, gives me a url structure of mysite.com/timber-frames/single- custom-post But I also want to have child pages (not posts) with the same url structure, like this: mysite.com/timber-frames/child-page The parent page works just fine...mysite.com/timber-frames...but any child page under that throws a 404. Again, flushing permalinks doesn't work. Thanks in advance!


title: How to create a drop down list with pages to a themes options page?

text: I'm building a themes options page using settings API. Everything is ok, but i now i want to create a drop down list populated with pages and i don't know how to! For example, i have this piece of code that show the list of pages, but when i select a page and cick on save, the page selected doesn't get saved!                   function  combo_select_page_callback() {     $options = get_option('journal_theme_blog_2_col');         echo "<select name='select_page'>      <option value=''>";     echo esc_attr( __( 'Select page' ) ); ?></option>      <?php       $pages = get_pages();       foreach ( $pages as $page ) {         $selected = '<option value="' . get_page_link( $page->ID ) . '">';         $selected .= $page->post_title;         $selected .= '</option>';         echo $selected;       }     echo '</select>';     }// end combo_select_page_callback      Thank for the help, nelson


title: How to make different custom post layouts?

text: I am new to wordpress, and have encountered some difficulty in making my own custom layouts. I'm using _S framework (underscore.me) as well as Custom Post Templates plugin. I'm using custom fields to inject images above the title of posts currently, and that's worked so far but I encounter problems when trying to make index- only custom layouts for post's as well as applying CSS to the custom fields. The custom index only post appearances are about three in number, one of which is how I want posts to look like by default. What I'd like to know is which files should I be looking at, and some guidance on how I should go about modifying (as some elements seem not to change when I wrap/apply CSS to them) to change the index only appearance as I currently am able to modify the appearance of the post page itself. If more info is required I can post it


title: Dynamic sidebar no longer functioning

text: I have 3 related websites in english, dutch and italian : www.gynsurgery.org, www.gynsurgery.be and www.mondoginecologico.it about 4 months ago I found the theme of the italian site changed to twenty eleven, while the original theme had disappeared I restaured the theme of the italian site from the english functional site, but cannot find why the dynamic sidebar is no longer functional Anybody a hint were to look ?


title: I get the following message The uploaded file could not be moved to /home/reascom/public_html/wp-content/uploads/2012/07

text: The uploaded file could not be moved to /home/reascom/public_html/wp- content/uploads/2012/07. This is the message I get when I try to load anything to my existing web site. images and themes get this message. What should i do?


title: (Solved) category link not working

text: I created a theme using wamp. It works fine and all, but when I uploaded it to the server, I am having problems with categories. It always generate this url: http://deremoe.com/reviews/ this is what get_category_link() is giving me on my webserver. It should be: http://deremoe.com/category/reviews/ What I did:   1. Reset Permalink   2. /?index.php/%postname% custom category What should I do more on this? Thanks.


title: How Do I Protect My Premium WordPress App Theme from Copying?

text: They say WordPress is GPL, and therefore all plugins and themes made with it are supposed to be GPL. Fine, but if I spent three months coding an extremely complex app theme with the intent on selling it repeatedly for profit, such as a medical office scheduling system theme, then how can I protect my investment, if even a moderate amount?


title: filtering special chars from post slug

text: Is there a way to prevent WordPress from including special characters like – (long dash), ", ', etc.. from the post slugs? Basically, I'd like to run the post-slug through a filter when it is created, and strip any special chars. The reason is, that it's giving me problems as these show up as utf8-urlencoded in my rss feed, and those links don't work.


title: Why is taxonmy-[taxonomyname].php not working?

text: I've registered a couple of custom taxonomies to go with a couple of custom post types but I'm having some trouble getting a template file to work. I've tried taxonomy.php, taxonomy-[termname].php, taxonomy-[taxonomyname].php but none seem to register and the link reverts to index.php You can see an example of this here - http://wordman.deanelliott.me/portfolio/ just click on any of the links inside the yellow box and instead of going to a specific taxonomy template page it uses index.php I'm not sure if it makes a difference, but this is the code I'm using to register the taxonomy               register_taxonomy('cat', 'portfolio',  array('hierarchical' => false, 'label' => 'Category','query_var'  => true, 'rewrite' => true));


title: Hook midway through the_content();?

text: Basically, I want to add a function that executes half way through the_content(); I want to add a message/ad block whatever in the middle of all of my content without having to go in to each individual page and add the block. Is this even possible?


title: Easy way to import a post from Word?

text: I have a post written in Microsoft Word with images, text and some formating. Is there some easy way to import this document into WordPress? Either a plugin for Word og perhaps a plugin inside WordPress? I'm looking for something simple that also converts images.


title: template_redirect called twice

text: I am working of a simple redirect plugin that match the given slug and redirect to the assigned url, which i supposed to working fine. But recently i am adding the functionality to update the stat for the visited slug and i found that my update query called twice, i checked and found that `template_redirect` hook called twice. My stat update query is applied on single time only. Here is my code:               add_action("template_redirect", array($this, "redirection_section"), 11);          function redirection_section() {         if( is_404() )             $this->uni_page_redirect();     }          function uni_page_redirect() {                  include_once dirname(__FILE__) . '/uni_links.php';             $Links = new UNI_Links();                  $slug = ltrim(preg_replace('#/$#', '', urldecode($_SERVER['REQUEST_URI'])), '/');                       if( $Links->is_valid_slug($slug) ) {                 // Initiate with Slug                 do_action("ulr_init_slug", $slug);                 $Links->generate_links($slug);                 exit();             }                  return false;              }      Now this is how i am updating my query:               function slug_init_callback($slug_name) {             global $wpdb;                  $table_slugs = ULR_TABLE_SLUGS;                  // Debug to check invoks             file_put_contents(PLUGIN_BASE . '/debug.txt', "call \r\n", FILE_APPEND);             $sql = $wpdb->prepare("update {$table_slugs} set stat= stat+1 where slug_name=%s", $slug_name);             $wpdb->query($sql);         }      Your help is highly appreciated. Thanks


title: WP_Query get posts from custom posts by category

text: ive been playing around with this for ages and for some reason I cant get it to work. This is from within the single post page of a custom post type... Basically I am getting the category of the custom post type by using the get_the_term and then doing a foreach to nicely input into a string. I then use a WP_Query to retrieve, but I think I have the logic wrong. This is what I have               // post types query     if ( have_posts() ) : while ( have_posts() ) :the_post();          // getting the categories     $categorynames = '';     $getcategory = get_the_terms($post->ID, 'custompostnamehere-categories');          foreach($getcategory as $t){ $categorynames .= $t->term_id.' ,';}          if (substr($categorynames, -1) == ',') {     $categorynames = substr($categorynames, 0, -1);     }          // end of post type query     endwhile; endif; wp_reset_query();           //starting new query to get related posts within the same categories     $args = array(       'post_type' => 'custompostnamehere',       'cat' => $categorynames,       'posts_per_page' => 20     );     $q = new WP_Query($args);          // retrieving the data     while($q->have_posts()){          }      Could someone please enlighten me on my wrong doings. Thanks


title: Remove default WordPress widgets

text: Hey guys here is the problem I have added 2 sidebars to my blog, however when I change their visibility to only appear on front page and when I click on a specific post ALL of the default widgets available appear for some reason. How do I change that?


title: How to add class to an html output element in tinyMCE paragraph drop down menu

text: I tried to modify the TinyMCE behaviour in the functions.php. I try to accomplish that e.g. h4 gets a class of "headliner" per default. I am half way there. I found a setting to create a drop down menu and within it is populated with my custom styles/classes:               function tinymce_mod( $init ) {         $init['theme_advanced_buttons2_add'] = 'styleselect';         $init['theme_advanced_styles'] = "Header 4=mus-bi";         return $init;     }     add_filter('tiny_mce_before_init', 'tinymce_mod');      but that way it is rather confusing to have two style related drop down menus: ![paragraph and style drop downs](http://i.stack.imgur.com/iED93.png) So would it be possible to just alter the wp native styles in the paragraph dropdown and assign the class "headliner" to the Header 4 in the paragraph drop down there and drop the style drop down? Best regards Ralf


title: How to remove title from category page in header

text:
I am trying to not show the page title on certain pages, including home, a custom post types page, and a category page (/category/blog). I came up with this, and it's working for everything but the blog page.               if ( !is_front_page()  && !is_post_type_archive('location') && !is_page_template('category-blog.php')) :

<?php the_title(); ?>

           endif;


title: Wordpress doesn't generate rel=prev & rel=next

text: I am developing a Wordpress theme from scratch and I've been using `previous_post_link()` & `next_post_link()` quite often and never had any trouble using them. Until now.. So what I'm trying to accomplish is the following: Person X is on a single blog post page and wants to navigate to the next or previous post without going back to the overview. Here's the thing: Wordpress generates the _rel=prev_ and _next_ tags in the `<head>` section for all pages except the ones that have something to do with the blog. So for example: single posts or the overview page. I haven't done any edits to the `wp_head()`; whatsoever so I am clueless on this one and I hope someone knows a non-plugin solution. **Edit:**   `previous_post_link()` & `next_post_link()` do work on custom post types, just not on the normal blog.


title: Change Query Arguments (filter) with jQuery/Ajax or PHP?

text: I have a pretty complex wordpress-site for travelling. There's an "archive- hotels.php", a template for the custom-post-type "Hotels". Inside the CPT is a taxonomy called "City", so we can do this: domain.com/hotels/city. Works perfectly. Now there's a filter on the site, which should filter the shown posts by stuff that the author has added over custom fields (Advanced Custom Fields Plugin) like "Features" or "Price Range". Now I'm not sure how to filter that query. With PHP? jQuery (there shouldnt be too much posts in hotels/city/)? or Ajax to work that dataload, which will be after years of publishing? Domain www.business-travelling.de/hotels/hamburg


title: Values inside a custom field to determine which category posts to display

text: I am facing a little problem whilst trying to display posts, from certain categories, on the front end. I've created a custom field whose key is 'related_categories' and I've different categories with slugs such as 'army', 'navy', 'airforce' etc. When creating a new custom post, I enter the slugs of different categories inside the 'related_categories' custom field, for e.g. 'navy', 'airforce', and this is the code which I've inside my template file to echo the custom field values inside the 'tax_query' array.               <?php global $post;          $related = array ( get_post_meta($post->ID, 'related_categories', true) );          $the_query = new WP_Query( array( 'post_type' => 'medals', 'posts_per_page' => 3, 'tax_query' => array( array( 'taxonomy' => 'medal-categories', 'field' => 'slug', 'terms' => $related, ), ), ) );           while ( $the_query->have_posts() ) : $the_query->the_post();           //loop starts after this      Now the problem which I am facing is that if I enter only one slug inside the 'related_categories' custom field, for e.g. 'navy', then the posts from the 'navy' category successfully show up but if I enter more than one slug inside the 'related_categories' custom field, for e.g. 'navy', 'army', then the posts do not show up. I tried searching for a solution on the internet but couldn't find any therefore any help would be appreciated. Thank you.


title: How to check a list or feed of all posts under a category and tag?

text: Consider this question from the point-of-view of a visitor to a WordPress blog, and not as a WordPress blog admin who can edit those numerous PHP files. How can I see a list of all the posts under a category and a tag? Not clear? Let me explain with an example: > I have two categories -- _Social Media (social)_ and _Web (web)_ , and I > have a tag _Tips and Tricks (tips-and-tricks)_. > > Consider that I use the tag frequently with posts under both categories. The > question is, how can a visitor to my blog, check posts tagged "tips-and- > tricks" and under "social" category? I am looking for a solution _similar to_ this: `http://example.com/feed/?cat=11,12` (which we use to combine rss feeds of multiple categories). Thanks.


title: Issues with page load after CSV export of database

text: I'm having an odd issue. I am using GEO my WP plugin (http://geomywp.com/) to create some custom post types and search forms on the front end. I am trying to import a database with about 600 posts (lots of information). Because I'm having some issues getting that information to import properly, I'm trying to export the existing database so I can compare it with the version I plan on importing. The odd issue: each time I export this using a plugin called WP CSV https://wordpress.org/plugins/wp-csv/ (which allows me to export all of the table information for just that post type)—I no longer can load any page of the site on any browser. This blank page (no html generated) lasts for an unspecific amount of time, I just have to refresh every few minutes (or hours) until the site is back. WP Supercache is deactivated—no other caching is on. I've tried resetting DNS Cache, and all browser cache, etc.. No cigar. Anyone experience something like this? The only assumption I can make is that the database is overloaded? Or that the server has some weird caching going on and I need to call my host. Any suggestions / shared experiences appreciated.


title: making changes within a wordpress theme

text: I am trying to find exactly where the changes can be made within a WordPress theme. I have looked into `index.php` and have the following, but have not found any files that match:               <?php     /**      * Front to the WordPress application. This file doesn't do anything, but loads      * wp-blog-header.php which does and tells WordPress to load the theme.      *      * @package WordPress      */          /**      * Tells WordPress to load the WordPress theme and output it.      *      * @var bool      */     define('WP_USE_THEMES', true);          /** Loads the WordPress Environment and Template */     require('./wp-blog-header.php');


title: wp_insert_post sometimes fails after API call

text: I have built a plugin that fires an Ajax call to connect to a third-party API. That API returns some Json, which I then save as a custom post with `wp_insert_post`. Now, usually, this works. But, now and again, the save fails, with a "MySQL server has gone away" error. I'm assuming this is because the API took too long to respond (maybe 30 secs), and so the connection closed. Does this sound like the correct conclusion? And if so, how can I handle this from within the plugin? EDIT: 20 secs doesn't seem long enough for a timeout, so I'm baffled by this one...


title: WP_Query of a custom post type isn't working

text: I am trying to `WP_Query` a custom post type. I would like to display the `post_title` s in a list. Here is my code, it doesn't seem to work:               <?php     add_action( 'init', 'custom_faq_type_mp' );     function custom_faq_type_mp() {         register_post_type( 'faq_type_mp', array(             'labels' => array(                 'name' => 'View current FAQs ',                 'singular_name' => 'FAQ',                 'add_new' => 'Add New FAQ',                 'add_new_item' => 'Add New FAQ',                 'edit' => 'Edit',                 'edit_item' => 'Edit FAQ',                 'new_item' => 'New FAQ',                 'view' => 'View',                 'view_item' => 'View FAQ',                 'search_items' => 'Search FAQs',                 'not_found' => 'No FAQs found', 'not_found_in_trash' => 'No Forms found in Trash',                 'parent' => 'Parent Form'             ),             'public' => true,             'menu_position' => 15,             'supports' => array( 'title', 'editor' ),             'taxonomies' => array( '' ),             'menu_icon' =>             plugins_url( 'images/image.png', FILE ),             'has_archive' => true         ) );     }           // change the new title line to     add_filter( 'enter_title_here', 'change_default_title' );     function change_default_title( $title ){         $screen = get_current_screen();         if ( $screen->post_type == 'faq_type_mp' ) {             return 'Enter New FAQ Here';         }     }           // Display the FAQs using a shortcode     add_action( 'init', ' mp_faq_register_shortcodes' );     function mp_faq_register_shortcodes() {         /* register the [display_faqs] shortcode */              add_shortcode( 'display_faqs', 'mp_faq_shortcode' );     }          function mp_faq_shortcode() {         /* Query albums from the database */         $loop = new WP_Query( array(             'post_type' => 'faq_type_mp',             'orderby' => 'title',             'order' => 'ASC',             'post_per_page' => -1,         ) );          /* check if any faqa were returned */         if ($loop->have_posts() ) {             /*open an unordered list */             $output = '';             / loop through the faqs (the loop) */             while ($loop->have_posts() ) {                 $loop->the_post();                 /*display the faq question */                 $output .= post_title() ,             } /*close the unordered list */             $output .= '';         } /*if no faqs were found */         else {             $output = 'No FAQa have been published.';         } /*return the faq list */         return $output;     }       My error is below the `// Display the FAQs using a shortcode` comment. Have you got any solutions? Thank-you.


title: Exclude page name from loop

text: I'm currently using this loop:               if (is_single() || is_page() ) :       if (have_posts() ) :         while (have_posts() ) :         the_post();      How can I exclude multiple pages within the loop?   For an example, I want to exclude pages `example.com/music` and `example.com/contact`. EDIT: I've done the way G.M provide, but my music and contact pages keeps loading after apply.               <?php if (is_single() || is_page() ) : if (have_posts() ) : $exclude_pages = array('music', 'contact'); while (have_posts() ) : if ( is_page() && ! empty($exclude_pages) && (           in_array($post->post_name, (array)$exclude_pages) ||           in_array($post->post_name, (array)$exclude_pages)       ) ) continue; the_post(); ?>     <meta name="description" content="<?php the_content_limit(150)?>" />     // loop continues     <?php endwhile; endif;      elseif (is_home() ): ?>     // loop continues          <?php endif; ?>          <?php if( is_page( 'music' )) { ?>     <meta property="og:image" content="" />     //loop continues     <?php } ?>      So to clarify: I'd like to exclude some meta tags that i'm generating via a loop in the header.php Now with my loop, all pages and post get affected by the loop. So I don't want the pages music and contact to have the same header tags from the loop in header.php.


title: Multisite blog converting categories to subdomains

text: Having `http://site.com/category/xyz` = `http://xyz.site.com/` I would like to move the content from each category to its equivalent subdomain blog, so that when I will access `http://site.com/new-post/`, where the post belongs to category `XYZ`, `site.com` will do a `301` redirect to `http://xyz.site.com/new-post/` So, is there any other way besides then the hardcore extracting data from database and move it to its new place?


title: get_comments() where parent is not 0

text: I need a way to get just the comments that aren't top level i.e. where parent is not 0. I've tried:               $args = array(        'parent' => -0     );     $comments = get_comments($args);      I know the parent comment id's (44 and 48) of all the comments I require, so I tried:               $args = array(        'parent' => array(44,48)     );          $comments = get_comments($args);      But this didn't work. It only returned one row. I need to stick with get_comments() if possible, as I've done a lot of work around it already so want to avoid losing what I've done.


title: Advanced Custom Fields select field : How to echo the label, not the value?

text: I am using the wordpress Advanced Custom Fields plugin. This question is about the select field, and in the documentation only tells me how to output the value, not the label/name. I can't see this functionally in the documentation and was wondering if anyone had any ideas? For example, to create Select field content, you simple do this...               gb : English     fr : Français     it : Italiano     de : Deutsch     pt : Português     es : Español     nl : Nederlands     be : Belgian     dk : Dansk     fi : Suomi     no : Norske     cz : Český     pl : Polski     hu : Magyar     ch : Schweiz     at : Österreich     eu : International         Then to output this, you write this...               <?php the_field('language'); ?>         For example if I select Polski in my post editor, the PHP will echo this value...               pl         I'm wondering if its possible to echo the label, I also want to be able to echo Polski, as well as the value pl. If anyone knows of any documentation on how to do this or if you could help with a solution that would be most awesome. Thanks in advance.


title: Wordpress database growing dramatically in size despite adding no new content

text: I have an old Wordpress site that I no longer maintain but keep online anyway. I have a cron job setup on the server that backs up the Wordpress database once a month. I am noticing a continuing growth in the size of the database backup. For example, if I go back a few years, the database size was under 3MB. It has kept gradually increasing over time - as of December last year it was 80MB and as of January this year it is now 116MB. I am curious to know whether this is a standard Wordpress problem/known plug- in problem and how one might go about identifying and addressing it. I'm not adding any new content of any sort and it's a low traffic site, so I don't suspect it's being overwhelmed with comments. Even the sum of all spam and legitimate comments is under 9100 (about 9000 are spam), and each comment would have to be consuming on the order of ~12KB in the database to explain the backup size, which seems rather large per comment.


title: How do I obtain the post content via a custom meta box inside the editor?

text: I have a custom meta box which I would like to use to report on the markup of the current post or page (number of words, number of heading tags, etc). How can I obtain the post content into memory in order to parse and report on its content inside the meta box?


title: A change in URL slug in database returns 404, how can I do auto-redirect?

text: I have a huge blog with over 10K posts and a lot of posts with some adult keywords in titles, urls, content and tags. I am trying to remove all adult ones with "search and replace" plugin. It works fine, but the problem is the url slugs also changes if there is a bad keyword in the url and the original url becomes 404. For example, http://www.domain.com/adult-keyword-url changes to http://www.renamed-keyword-url which is fine, but the adult keyword url is now 404 and does not redirect to renamed url. Is there a way that the original url automatically do 301 redirects to the changed url? I tried using the redirection plugin too which claims to auto-redirect such posts. It works fine only when you manually change the url slug of a post and update a post. But it does not work in this case when you are updating a lot of posts by directly changing the database with search and replace plugin.


title: Custom hierarchal taxonomy loses interface hierarchy when selecting parent & children

text: I have a custom hierarchical taxonomy that is called 'Categories', but serves a different area of the site than the default "Categories" taxonomy. The problem I'm having is with selecting children terms in the interface while posting content. If the user selects and children terms, they move to the top of the Categories box and lose association and visual hierarchy with its parent. Here's an image showing what happens: ![Checked categories are moved to the top of the list, breaking the hierarchy](http://cl.ly/30e9/content) I haven't set any unusual parameters that I know of, here's the register_taxonomy call:               register_taxonomy( "workshop_categories", 'workshop',         array(             "label" => "Categories",             "singular_label" => "Category",             "rewrite" => true,             "show_ui" => "true",             'hierarchical' => true,             'rewrite' => array('slug' => 'category')         )     );      Any input is appreciated!


title: Recommendationf for Quiz Plugin that saves results

text: I'm building a learning site, and need a quiz plugin that will help track student progress through the lessons; thus I want a log of each member that took the quiz, along with date time and score. Does anything like that exist?