title: Display a post count from a custom metabox selection

text: **I was wondering if this is possible.** I have a custom post type call projects that displays a metabox with drop down menu. In that drop down menu I have a few choices listed, draft, open, pending, and completed. Once you select which field you would like, I would like the ability to display a post count of that choice on the front end from the selected author only when they are login. Example would be author A selects complete 4 times on 4 different posts. So when author A logs onto the site he will see on the front end a number 4 with the word completed. This is what I am using to display the drop down menu                array(                 'name'    => __( 'Project Status', 'projects' ),                 'desc'    => __( '', 'projects' ),                 'id'      => $prefix . 'project_select',                 'type'    => 'select',                 'options' => array(                     'Select a Status' => __( 'Select a Status', 'projects' ),                     'Draft' => __( 'Draft', 'projects' ),                     'Open'   => __( 'Open', 'projects' ),                     'Pending'     => __( 'Pending', 'projects' ),                     'Closed'     => __( 'Closed', 'projects' ),                     'Completed'     => __( 'Completed', 'projects' ),                 ),


title: Media upload finished hook

text: I'm developing a plugin which uses wordpress's thickbox media library to handle media upload and selection. All is well but for the fact that I would like to automatically 'redirect' to the 'media library'-tab after I uploaded/ wordpress finished crunching the file. So basically i'm looking for a hook that's fired after the crunching of an uploaded file is finished. I can't imagine this would be such an extreme thing but I can't seem to find the right hook for this.


title: If on Category Page add "active" class?

text:
I am trying to register an "active" class on my `li` if the category matches the page. If you click the `horror` category it will show you a loop with all the videos in that category. But the button for `horror` does not show an active class. I know I need an `if else` statement but the things I have tried simply do not work and break the site. Im not good enough with PHP or Wordpress to really figure this out. Site here **CATEGORY.PHP**               $args = array(             'orderby' => 'name',             'parent' => 0             );           $categories = get_categories( $args );           foreach ( $categories as $category ) {             echo '
 term_id ) . '">' . $category->name . '
';     }         **Can something like this do the trick?**               if ( $category->slug == $category->term_id )


title: Custom Widget Area outside theme's border

text: I'm having an issue i would like your help with. I am a beginner with wordpress and wordpress themes so your patience would be appreciated! I am running a website www.besmart.com.cy and i have used a wordpress theme builder to build my theme from scratch. This is what i am trying to accomplish:screenshot. Through the theme builder i did not manage to do that. The way i am trying to accomplish this is by creating new custom widget areas on the left and right of my website so i can place plugins that will display photos (ads). I have registered my new custom widget areas in the functions.php and i can see them normally in my Widgets area from the WordPress admin panel. I have also adjusted their size and position through style.css. My questions are:   * Where should i place the new sidebars to get displayed where i want them? I have tried placing them in my header.php and although i can see them where i'm supposed to, my whole site gets dragged down (screenshot)   * Am i doing this the wrong way? Is there an easier way to do it - a plugin perhaps? Thanks in advance, Charis


title: Display single most recent post in category on every page of category archive

text: I am trying to display a single "featured post" in the archive.php template using a custom query. This featured post should be the **most recent post** in that category or tag. I'm using pagination for the rest of the archive page (also a custom query so that pagination is retained), and this **same post** should appear at the top of **all the subsequent pages** (i.e. /page/2/, /page/3/, etc.) I've got this working on home.php, but archive.php is showing the most recent post from _each page_ , not overall. This is what I'm using in archive.php.               global $query_string;     $query_args = explode("&", $query_string);          $args = array(         'posts_per_page' => 1,         'post_not_in' => get_option( 'sticky_posts' )     );          $query1 = new WP_Query($args);          if ( $query1->have_posts() ) {           while( $query1->have_posts() ) {               $query1->the_post();                   get_template_part( 'content', 'latest' );         }     }           wp_reset_postdata();       And here's the working code from home.php:                   $args = array(             'posts_per_page' => 1,             'post_not_in' => get_option( 'sticky_posts' )         );              $query1 = new WP_Query($args);              if ( $query1->have_posts() ) {               while( $query1->have_posts() ) {                   $query1->the_post();                       get_template_part( 'content', 'latest' );             }         }               wp_reset_postdata();      Hope I've expressed myself clearly. Any help would be greatly appreciated :)


title: display only the title of the post into a certain category

text: My site works with phrases and texts In one category, the users send statements and debate about it. In another category, are sent statements and debate about them. I would like to show only the title of the post into a certain category, since they are not phrases and content needs, just the title. in another category, the pots are usually shown, with title and content. as might be the code in single.php if you are in category X displays content and title Y if the category content is not displayed, only the title


title: Best way to get user id for get_users function?

text:
I'm trying to make a table of users by role type. What is the best-practices method of getting the user id? My goal is to print each users first & last names, username and email. What I have now:               $get_admins = array(         'blog_id' => $GLOBALS['blog_id'],         'role' => 'administrator',     );          $blogusers = get_users($get_admins);     foreach ($blogusers as $user) {      $userid = get_userdata($bloguser->user_id);     $user_info = get_userdata($userid);              echo '
';             echo ''. $user_info->user_firstname .'	';             echo ''. $user_info->last_name .'	';             echo ''. $user->user_login .'	';             echo ''. $user->user_email .'	';         echo '
';     }      note: In my example above getting the user id does not work. Codex reference: get_users()


title: Hosting plugin Google Code with auto update?

text: I've been developing a WordPress plugin for a friend who needs something completely out-of-the-box, at least what WordPress is cornerned. Now, I could use the WordPress plugin repository to host this, but I've already hosted this project on Google Code and was wondering if there was any fancy code which would make WordPress check for updates from that repository. I feel this plugin isn't really for the general WordPress crowd and don't want to clutter the directory. So I was wondering if this was possible. Thanks! Davey


title: Voting System, database connections?

text: Basically I'm trying to make it so that all pending posts can be voted on if the user is logged in. once it gets to 10+ votes it will become published. OK so no longer using database connections and now using Meta Keys, therefore the code has been changed to show what I now have               <?php      //if the post is pending show     if(get_post_status() == 'pending') {          //added a post_vote to the wp_posts database for use later          //if the user is logged in show     if ( is_user_logged_in() ) {              add_post_meta( get_the_ID(), 'post_vote', '0', true );         $post_vote = get_post_meta( get_the_ID(), 'post_vote' );         echo 'Votes: ' .  print_r( $post_vote);         //form for submit button         echo "<form method=\"POST\" action=\"";         echo '';  //code in here for adding 1 to meta         echo "\">";         echo '<input type="button" name="submit" value="+">';         echo '</form>';          } else {         echo'Please Sign in to Vote';     }          } else {     // do nothing     }      ?>      The following                   add_post_meta( get_the_ID(), 'post_vote', '0', true );         $post_vote = get_post_meta( get_the_ID(), 'post_vote' );         echo 'Votes: ' .  print_r( $post_vote);      Returns this "Array ( [0] => 0 ) Votes: 1" It should only say "Votes: 0"


title: Separate table or usermeta

text: We are creating custom fields for users like annual income, gender, city, country, etc. There are about 10 odd new fields. We will be importing approx. 30,000 records for each user in a month through a CSV import function. There will be new as well as update to old records. The process will continue for a year. In this scenario, please suggest which option to choose from Scenario 1: Create a new WordPress table with these new fields Scenario 2: Use wp_usermeta to add custom fields Apart from CSV import, we will be regularly extracting reports of users. This will keep the wp_usermeta table busy. Please suggest which scenario we should go far and why? My recommendation is to go for Scenario 1 as here we can use WordPress functions quite efficiently though the database load will be high.


title: Pre Get Posts fails with more than 1 Post Type

text:
**Inside Functions.php**               function custom_filings_archive( $query )      {         if(is_post_type_archive( 'filings' ))         $query->set('post_type',array('the-reports','press-release'));         return $query;     }     add_action( 'pre_get_posts', 'custom_filings_archive' );      **Inside archive-filings.php**               while(have_posts()):the_post();     the_title();?>

     <?php     endwhile;      **Result: Reverts to index.php and does not work..... However... if I set the pre-get posts to just 1 custom post type then it works just fine.... I want to have more than one post type though.**


title: Get Link to Feed On Term or Taxonomy

text: Instead of building the link myself, I was wondering if wordpress has a function which generates a link to a given feed, be it a taxonomy, term, or post type. Perhaps it might even generate the little feed icon. Before building it myself, it occurred to me they probably have a function. But my research turns up nothing.


title: How to use/enable Pagination?

text:
I'm creating a shortcode to display the list of users with a particular profile in WordPress. But I can not enable or display the pagination. I have 25 users on my site and would like to display 5 profile users per page and include the pagination. I added a new Role student, and multiple custom fields using Advanced Custom Fields for the student profile. So I need to display a list of students as the appropriate fields. So far so good, the problem is with paging that I could not enable. Here a example of my code:               add_shortcode('list-users', 'list_users');          function list_users($atts){          global $wpdb;          $args = array(         'blog_id'      => '',         'role'         => 'student',         'meta_key'     => 'pw_user_status', //I'm using the New User Approve Plugin         'meta_value'   => 'approved',//If user is denied, he is not appears in the list         'meta_compare' => '',         'meta_query'   => array(),         'include'      => array(),         'exclude'      => array(),         'orderby'      => 'display_name',         'order'        => 'ASC',         'offset'       => '',         'search'       => '',         'number'       => '2',         'count_total'  => true,         'fields'       => 'all',         'who'          => ''     );          $students = get_users($args);          if(is_user_logged_in()){          $content = "
";             foreach($students as $student){              $content .= "
";         $content .= "
";         if(current_user_can('administrator')){            $link_of_profile_of_user = get_edit_user_link($aluno->ID);            $content .= ""."Edit this profile"."";          }         $content .= "
";         $content .= get_avatar($student->ID);         $content .= "Name: " . get_the_author_meta('display_name', $student->ID) . "
";         $content .= "Date of Birth: " . get_the_author_meta('date_of_birth_acf_student', $student->ID) . "
";         $content .= "Course: " . get_the_author_meta('course_acf_student', $aluno->ID) . "
"         $content .= "Email: " . get_the_author_meta('user_email', $student->ID) . "
";         $content .= "Phone: " . get_the_author_meta('phone_acf_student', $student->ID) . "
";         $content .= "City: " . get_the_author_meta('city_acf_student', $student->ID) . "
";         $content .= "
";             }//close foreach          $content .= "
";              return $content;          }//close the conditional for user logged          }//close function


title: WP Supersized & Easy Fancybox Conflict

text: I am using WP Supersized and Easy Fancybox Wordpress plugins. Everything is works fine till the point I am not clicking the link to open a fancybox. Image is opening perfectly just having some issues with the position. Its shifting towards the left on opening up. Here is the link to my demo page where I am using fancybox : http://martinushoeve.dig-id.be/?page_id=5 Regards.


title: Redirect user after login/registration globally

text: How it possible to redirect all users, even administrators after login to specific page? And also redirect users after successful registration? Any simplest way? For example I want to redirect users after login, to the "Updates" page of my website. And after registration, to the "Home" page of website.


title: How can I get all author written content?

text: I have a site that needs two different tabs: 1. all author written content (Posts, comments, CTP) 2. all author _followed_ content (categories, taxonomies, other users content) For the first all I could come up with was using unoion on wp_comments and wp_posts filtered by author sorted by date Have no idea how to do the 2nd one... Would love some advice


title: Retrieving a list of menu items in an array

text: I am currently am working on a custom theme. In this theme, I have a menu that I registered using `register-nav-menu`, and then I am displaying the menu to my web page using the `wp_nav_menu` function. However, I like to retrieve the list of menu items only (the actual menu item names only that were used in wp-admin area to create the menu, and without any html), and I would like save that list of items to an array (i.e, mot display it). So, a psuedo code would look like this               $menu_items = get_list_of_items($name_of_menu); // $name_of_menu is the result of register-nav-menu, and get_list_of_items is the psuedo function     foreach ($menu_items as $item) {         // do something with the item     }      Is there a way of doing so? Thanks.


title: same comment list for two posts

text: I've an unique problem, I'm using WPML to translate my website. WPML takes post and duplicates it, so that translation becomes another post. Thus keeping Gallery/Comments/Ratings separate. I'm on the quest to unite Gallery/Comments/Ratings for all languages. Problem is with comments, because wp-list-comments function doesn't accept post ID as an argument. What are my options? how do I unite comments of two posts? given that I know ID of parent and ID of translation? I think this is an interesting question :) ty!


title: How to merge two or more WordPress posts?

text: I need to be able to merge two or more posts. What is the exact query (or queries) to make this happen? The scenario is multiple recommendations that need to be merged into one. I have already sorted out comments merging and meta merging. Let's say a user recommends **Bill Gates** , another one **Gates Bill** and another one makes a typo and adds **Bil Gates**. I need to merge these three posts and choose the destination one. **UPDATE:** What I need is a complete SQL query for deleting a post and all references to that post. Something like this pseudo-code:               DELETE FROM wp_posts WHERE id = X;     DELETE FROM wp_posts_meta WHERE id = X;     DELETE FROM wp_another_table WHERE id = X;     DELETE FROM wp_yet_another_table WHERE id = X;      where X is the ID of my post. The code (or plugin) shouldn't auto-detect duplicates. I will present the user a dropdown with a list of posts and the "Delete" option. Before deleting, I will copy the post content from one post to the other using an SQL UPDATE query. **UPDATE 2:** I think I found something, I'll have to check though:                   $custom_field_keys = get_post_custom_keys($postid);         foreach($custom_field_keys as  $key => $value) {             $valuet = trim($value);             if('_' != $valuet{0} ){                    delete_post_meta($postid, $key, '');             }        }        $result = wp_delete_post($postid);


title: wordpress database restore - broken link

text: I've tried to play with db backup and restore but I am dealing with difficulties. This what I've done: I backed up database using cPanel option and got 8MB large SQL file. Afterwards I installed new Wordpress in it's own new home. I accessed database associated with new installation of Wordpress through phpMyAdmin and dropped all the tables. Then I clicked on Import and choose to upload file from my Computer. After some time process reported it's success with over 200 queries executed. I checked the database and tables were really there with content as well. Now when I tried to start my new WP instance with hope to get it populated with DB data I get a broken link error, like URL that I've entered doesn't even exist. I tried to keep it simple so I changed new WP `wp-config.php` to direct to an actual database(not backup) but then I get the old site run with page not found error. Let me point that I installed new WP instance in existing WP installation folder. I placed it in a new folder of course called `development`. That makes it: example.com (being my live version) example.com/development (testing version) So testing version works fine with default install but once I change it's config file to overwritten database it gets broken, or when I change it to use main database(example.com) I get Page not found error generated by Wordpress. Hope all this makes sense. Any help appreciated.


title: enqueue_scripts() in child theme doesn't work

text: I'm trying to enqueue my "scripts.js" located at the root folder of my child theme. I don't understand why the following code (located in "functions.php") doesn't work:               function enqueue_scripts() {     if ( ! is_admin() ) {         $scriptsrc = bloginfo('stylesheet_directory') . '/scripts.js';              wp_register_script( 'scripts', $scriptsrc );             wp_enqueue_script( 'scripts' );         }     }     add_action( 'wp_enqueue_scripts', 'enqueue_scripts' );


title: In Which Contexts are Plugins Responsible for Data Validation/Sanitization?

text: I want to make sure all of the data in my plugins/themes is handled securely before entering the database and before being output to the browser. My problem is that there are situations where the API handles the sanitization for you -- like when saving post meta fields -- and others where the plugin/theme author is wholly responsible for doing it -- like when saving custom settings. For the scope of this question, I'm not concerned about validating data at the domain level -- e.g., checking that an Age field on a form is between 0 and 120, or that an e-mail address is valid. I'm only concerned about security -- e.g., escaping SQL queries to avoid SQL injection when saving to the database, or sanitizing data that's output to HTML templates to avoid XSS. For output sanitization, I know that you always need to use functions like `esc_html()` and `esc_attr()` when echo'ing variables into HTML templates. But, what about when using template tags? Do they all sanitize the output already? If so, for which context (general HTML, tag attributes, etc)? Some functions have variants for different contexts (like `the_title_attribute()`, but most don't. For input sanitization, I know that I need to use `$wpdb->prepare()` when making manual queries, but what about when using the Settings API to create a plugin settings page, or saving post meta fields for a custom post type? Right now I've just been digging through Core and reading tutorials every time I use a function to find out if it sanitizes or not, but that's error-prone and time consuming. I'm hoping to find some kind of comprehensive list of all the possible situations and whether or not the API handles it. e.g., # API validates/sanitizes   * Saving post meta with `update_postmeta()`   * Saving user meta with `update_user_meta()`   * Outputting a post title - use the contextually appropriate variant of `the_title()`   * etc # You have to manually validate/sanitize   * Saving plugin options with the Settings API. Pass a callback as the 3rd parameter of `register_setting()`.   * Direct database queries: Wrap the query in `$wpdb->prepare()`.   * Outputting variables in HTML. Use `esc_attr()`, `esc_html()`, etc   * etc I'd also be interested to understand why the API provides it in certain situations, but not others. I'm assuming it has something to do with the unknown nature of the data, but would love to hear a thorough explanation.


title: Adding SSL verification seal javascript from Thawte breaks website

text: We are trying to add Thawte SSL seal javascript to our website, but it keeps everything else from loading if added to a normal text widget. For example, if we add it to where the Thawte SSL image link it is right now on the sidebar of the site - then it does not load the footer or anything on the sidebar below it. The javascript from Thawte is:               <script type="text/javascript" src="https://seal.thawte.com/getthawteseal?host_name=www.billioncreation.com&size=S&lang=en"></script>       Any suggestions?


title: after wordpress update to 3.5+ i get many errors in plugin wpdb::prepare()

text: after wordpress update to 3.5+ i get many errors in this plugin. i found that the reason is: http://make.wordpress.org/core/2012/12/12/php-warning-missing- argument-2-for-wpdb-prepare/ I do not understand how to fix it. If anyone can help me with these problems or give me an example of how to fix it. this is the plugin core file http://pastebin.com/Tk5Gf1HR               WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘wp_jsrm_menus’ at line 1 for query SHOW TABLES LIKE wp_jsrm_menus made by activate_plugin, do_action(‘activate_simple-retail-menus/simple-retail-menus.php’), call_user_func_array, jsrm_activate_loop, jsrm_activate     WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘wp_jsrm_items’ at line 1 for query SHOW TABLES LIKE wp_jsrm_items made by activate_plugin, do_action(‘activate_simple-retail-menus/simple-retail-menus.php’), call_user_func_array, jsrm_activate_loop, jsrm_activate     PHP Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/simple-retail-menus/simple-retail-menus.php on line 169 and defined in /wp-includes/wp-db.php on line 992     PHP Warning: mysql_fetch_array() expects parameter 1 to be resource, integer given in /wp-content/plugins/simple-retail-menus/simple-retail-menus.php on line 170     PHP Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/simple-retail-menus/simple-retail-menus.php on line 173 and defined in /wp-includes/wp-db.php on line 992     WordPress database error Duplicate column name ‘menuorder’ for query ALTER TABLE wp_jsrm_menus ADD menuorder mediumint(9) NOT NULL made by activate_plugin, do_action(‘activate_simple-retail-menus/simple-retail-menus.php’), call_user_func_array, jsrm_activate_loop, jsrm_activate, jsrm_update_db_tables     PHP Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/simple-retail-menus/simple-retail-menus.php on line 176 and defined in /wp-includes/wp-db.php on line 992     WordPress database error Duplicate column name ‘label’ for query ALTER TABLE wp_jsrm_menus ADD label tinytext NOT NULL made by activate_plugin, do_action(‘activate_simple-retail-menus/simple-retail-menus.php’), call_user_func_array, jsrm_activate_loop, jsrm_activate, jsrm_update_db_tables     PHP Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/simple-retail-menus/simple-retail-menus.php on line 179 and defined in /wp-includes/wp-db.php on line 992     WordPress database error Duplicate column name ‘itemheader’ for query ALTER TABLE wp_jsrm_menus ADD itemheader tinytext NOT NULL made by activate_plugin, do_action(‘activate_simple-retail-menus/simple-retail-menus.php’), call_user_func_array, jsrm_activate_loop, jsrm_activate, jsrm_update_db_tables     PHP Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/simple-retail-menus/simple-retail-menus.php on line 182 and defined in /wp-includes/wp-db.php on line 992     WordPress database error Duplicate column name ‘valueheader’ for query ALTER TABLE wp_jsrm_menus ADD valueheader tinytext NOT NULL made by activate_plugin, do_action(‘activate_simple-retail-menus/simple-retail-menus.php’), call_user_func_array, jsrm_activate_loop, jsrm_activate, jsrm_update_db_tables     PHP Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/simple-retail-menus/simple-retail-menus.php on line 189 and defined in /wp-includes/wp-db.php on line 992     WordPress database error Duplicate column name ‘valueheader2′ for query ALTER TABLE wp_jsrm_menus ADD valueheader2 tinytext NOT NULL made by activate_plugin, do_action(‘activate_simple-retail-menus/simple-retail-menus.php’), call_user_func_array, jsrm_activate_loop, jsrm_activate, jsrm_update_db_tables     PHP Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/simple-retail-menus/simple-retail-menus.php on line 193 and defined in /wp-includes/wp-db.php on line 992     HP Warning: mysql_fetch_array() expects parameter 1 to be resource, integer given in /wp-content/plugins/simple-retail-menus/simple-retail-menus.php on line 194     PHP Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/simple-retail-menus/simple-retail-menus.php on line 197 and defined in /wp-includes/wp-db.php on line 992     WordPress database error Duplicate column name ‘image’ for query ALTER TABLE wp_jsrm_items ADD image tinytext made by activate_plugin, do_action(‘activate_simple-retail-menus/simple-retail-menus.php’), call_user_func_array, jsrm_activate_loop, jsrm_activate, jsrm_update_db_tables     PHP Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/simple-retail-menus/simple-retail-menus.php on line 200 and defined in /wp-includes/wp-db.php on line 992     WordPress database error Duplicate column name ‘linked’ for query ALTER TABLE wp_jsrm_items ADD linked tinyint(1) NOT NULL made by activate_plugin, do_action(‘activate_simple-retail-menus/simple-retail-menus.php’), call_user_func_array, jsrm_activate_loop, jsrm_activate, jsrm_update_db_tables     PHP Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/simple-retail-menus/simple-retail-menus.php on line 203 and defined in /wp-includes/wp-db.php on line 992     WordPress database error Duplicate column name ‘linkurl’ for query ALTER TABLE wp_jsrm_items ADD linkurl tinytext made by activate_plugin, do_action(‘activate_simple-retail-menus/simple-retail-menus.php’), call_user_func_array, jsrm_activate_loop, jsrm_activate, jsrm_update_db_tables     PHP Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/simple-retail-menus/simple-retail-menus.php on line 206 and defined in /wp-includes/wp-db.php on line 992     WordPress database error Duplicate column name ‘itemhidden’ for query ALTER TABLE wp_jsrm_items ADD itemhidden tinyint(1) NOT NULL made by activate_plugin, do_action(‘activate_simple-retail-menus/simple-retail-menus.php’), call_user_func_array, jsrm_activate_loop, jsrm_activate, jsrm_update_db_tables     PHP Notice: Undefined variable: vh in /wp-content/plugins/simple-retail-menus/simple-retail-menus.php on line 212     PHP Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/simple-retail-menus/simple-retail-menus.php on line 213 and defined in /wp-includes/wp-db.php on line 992     WordPress database error Duplicate column name ‘value2′ for query ALTER TABLE wp_jsrm_items ADD value2 tinytext NOT NULL made by activate_plugin, do_action(‘activate_simple-retail-menus/simple-retail-menus.php’), call_user_func_array, jsrm_activate_loop, jsrm_activate, jsrm_update_db_tables      **the errors comes from this code: i tried to fix as Charles Clarkson suggested but seems not helping.**               [11-Oct-2013 05:27:09 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'wp_jsrm_menus' at line 1 for query SHOW TABLES LIKE wp_jsrm_menus made by activate_plugin, do_action('activate_simple-retail-menus/simple-retail-menus.php'), call_user_func_array, jsrm_activate_loop, jsrm_activate     [11-Oct-2013 05:27:09 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'wp_jsrm_items' at line 1 for query SHOW TABLES LIKE wp_jsrm_items made by activate_plugin, do_action('activate_simple-retail-menus/simple-retail-menus.php'), call_user_func_array, jsrm_activate_loop, jsrm_activate     [11-Oct-2013 05:27:11 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'wp_jsrm_menus' at line 1 for query SHOW TABLES LIKE wp_jsrm_menus made by do_action('activate_simple-retail-menus/simple-retail-menus.php'), call_user_func_array, jsrm_activate_loop, jsrm_activate     [11-Oct-2013 05:27:11 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'wp_jsrm_items' at line 1 for query SHOW TABLES LIKE wp_jsrm_items made by do_action('activate_simple-retail-menus/simple-retail-menus.php'), call_user_func_array, jsrm_activate_loop, jsrm_activate     [11-Oct-2013 05:27:11 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'wp_jsrm_menus' at line 1 for query SHOW TABLES LIKE wp_jsrm_menus made by do_action('activate_simple-retail-menus/simple-retail-menus.php'), call_user_func_array, jsrm_activate_loop, jsrm_activate     [11-Oct-2013 05:27:11 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'wp_jsrm_items' at line 1 for query SHOW TABLES LIKE wp_jsrm_items made by do_action('activate_simple-retail-menus/simple-retail-menus.php'), call_user_func_array, jsrm_activate_loop, jsrm_activate     [11-Oct-2013 05:30:45 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'wp_jsrm_menus' at line 1 for query SHOW TABLES LIKE wp_jsrm_menus made by activate_plugin, do_action('activate_simple-retail-menus/simple-retail-menus.php'), call_user_func_array, jsrm_activate_loop, jsrm_activate     [11-Oct-2013 05:30:45 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'wp_jsrm_items' at line 1 for query SHOW TABLES LIKE wp_jsrm_items made by activate_plugin, do_action('activate_simple-retail-menus/simple-retail-menus.php'), call_user_func_array, jsrm_activate_loop, jsrm_activate


title: How do I make the server response faster on search results

text: I have my own virtual server in the cloud, running nginx and APC. On this server I have one wordpress blog using the W3TC-plugin. I've enabled page cache and object cache using APC. When accessing front page, pages and posts the response from the server comes almost instantly. But when doing a search, the response takes 1 second. I'm wondering if it is possible to make the response faster. Using the Debug Queries WP-plugin I've profiled the search sql query and it only takes 0.002 to complete. And according to W3TC most objects are cached. In fact, the Debug Queries plugin give the following report on a search result:                   Total query time: 0,01482s for 120 queries.         Page generated in 0,00000s, 0,00% PHP, 0,00% MySQL      So it seems as if the page is generated very quick. But the response from the server still takes 1 second to complete. How can I find out what it is that makes the response is taking long, even though the page is generated quick? _Note: I'm only talking about the response time from the server, not the time that it takes to generate the page in the browser._ Here is a example search result from my site.


title: How to bring custom meta boxes to custom post types?

text: I had created a custom meta box with the help of this answer but this meta box only appear in Post edit screen. How I can make it visible on "Pages" as well as on custom post types which created by my current theme. **Update:** The code is from `function.php` which add Custom Meta Box:                   /* Define the custom box */     add_action( 'add_meta_boxes', 'wpse_61041_add_custom_box' );          /* Do something with the data entered */     add_action( 'save_post', 'wpse_61041_save_postdata' );          /* Adds a box to the main column on the Post and Page edit screens */     function wpse_61041_add_custom_box() {         add_meta_box(              'wpse_61041_sectionid',             'Does this page is in Englsih?',             'wpse_61041_inner_custom_box',             'post',             'side',             'high'         );     }      I do not understand how to add `page` & `custom-post-types` to make that `meta-box` visible there.


title: Custom Post Type or Custom Tables?

text: I am trying to build an application that takes 2 pieces of input from a user and saves it to the database. This is how users enter these two pieces of input; this form will be displayed using shortcode: ![this is how users enter these two pieces of input; this form will be displayed using shortcode.](http://i.stack.imgur.com/9FXHA.jpg) I have tried Custom Post Type, but its concept is foreign and confusing to me - I don't know if I should use pre-existing fields (Title, Content) or create the fields to store the input in the database, or create a separate table to store all of this information. Here is my code:               // Register Custom Post Type     function int_init() {              $labels = array(             'name'                => 'Stories',             'singular_name'       => 'Story',             'menu_name'           => 'Story',             'parent_item_colon'   => 'Parent Stories:',             'all_items'           => 'All Stories',             'view_item'           => 'View Story',             'add_new_item'        => 'Add new Story',             'add_new'             => 'New Story',             'edit_item'           => 'Edit Story',             'update_item'         => 'Update Story',             'search_items'        => 'Search Story',             'not_found'           => 'No story found',             'not_found_in_trash'  => 'No story found in Trash',         );         $args = array(             'label'               => 'int',             'description'         => 'INT information pages',             'labels'              => $labels,             'supports'            => array( 'title', 'editor', ),             'hierarchical'        => false,             'public'              => true,             'show_ui'             => true,             'show_in_menu'        => true,             'show_in_nav_menus'   => true,             'show_in_admin_bar'   => true,             'menu_position'       => 5,             'menu_icon'           => '',             'can_export'          => true,             'has_archive'         => true,             'exclude_from_search' => false,             'publicly_queryable'  => true,             'capability_type'     => 'post',         );         register_post_type( 'int', $args );          }          // Hook into the 'init' action     add_action( 'init', 'int_init', 0 );      All this code does is show the Title and Content fields in the backend. Should I just use the Title and Content fields to store the input, or should I create new fields, or create a custom table to store this data? How do I add new fields to use in a project such as this? How would you approach this problem? **EDIT:** The content is unique per user inasmuch _every_ user will be asked to enter two pieces of alpha numeric data per submission using a form created using shortcode. I know how to do this already. The pair of data items entered will be saved to the database, and will need to be retrieved and posted on the public side of the site. The pair of data items will be retrieved and displayed on one page for each data pair as such: _I want to_ **eat a peanut butter sandwich** _then_ **drink a glass of milk**. The submitted data is shown as bold. This retrieval and formatting of the data will be done using shortcode. I do not know how to create custom fields to make this work. The data is submitted on the public side of the site by users who are not logged into the site. To recap my problem, I don't know how to store the pair of data. Do I use pre- existing Title and Content fields or do I create something different?


title: Why should I put if(have_posts()), is while(have_posts()) not enough?

text:
I have a question about "the loop".               <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>     <?php endwhile; else: ?>
<?php _e('Sorry, no posts matched your criteria.'); ?>
     <?php endif; ?>      Code taken from The Loop WordPress Codex page. Why should I put `if` part? It seems like if there is `while` loop, works fine. In what case problem occurs if there is no `if` statement? ## Edit I accepted @Chip's answer. but honestly saying I need only last part. I know now what I wanted to know from my question. > `if` statement is only when necessary, if you want to put a header or footer > that should be write only once. if you don't use the "wrapper", then `if` > statement is not necessary.


title: menu dissaperead after upgrade

text: I have just upgraded to WP 4.0 and item Menu has disappeared from administration. I can not understand this. It never happened before. I call the menu by this function:               add_theme_support( 'menus' );     if ( function_exists( 'register_nav_menus' ) ) {         register_nav_menus(             array(               'main-menu' => 'Hlavní menu',             )         );     }      Does anybody have this problem too?


title: Woocommerce - Making product pages child of shop

text: I'm new to WordPress and trying out woocommerce, but I've ran into a small problem. Here is my site. The products pages are no childs of the _Shop_ page, so whenever I click on a product, the active underline under _Shop_ disappears. Does anyone know how to change this? Im using the Mystile theme.


title: Uploaded files have permission 000

text: two days ago i updated wp to the newest version and this problem occurs since then. when i upload files to the media library, their file permissions are set to 000. means no rights. the files are copied to the server, but since nobody has any right to read / write / execute i can't do anything with it (the files are defenetly on the server, but wp can not create the thumbnails etc. and i can't view the files with my ftp client, but when i download them, they are just fine). the uploads folder and all containing folders have 777 and i cant find any solution to this. is it some hosting problem, that just popped up?? thanks for the help


title: How to populate a Wordpress install with a lot of categories, quickly?

text: I'm looking at starting a new project, but I've not done anything like this before. I'm hoping someone with more experience will be able to offer me advice on this one. The site revolves around geographical structure. It's the UK, cut into 50 parts. Each part has many towns, and within each town, many services. Each of the 50 sites will be a different URL, all running on a multisite. It's going to take quite a while to set up the first area, and all the towns. All towns and services will be categories in the admin panel. Once this is done, I need a fast way of populating the other 29 installs! I'll be seeking a way to effectively "find and replace" town names, so that page titles, meta and categories can be re-used over and over. Is this possible? How would you tackle this? At the moment, I've no real ideas, apart from sitting here with PHP and seeing if I can pass a huge array of towns through a function which adds categories for each town and inserts them into the database... I know this isn't a question, like "how do I fix this code" but I don't know how to plan for this, and with no plan I think I'm stuffed :)


title: Is there a WordPress theme for twittstrap?

text: I would like to know if there is a WordPress theme that uses twittstrap (a derivative from Twitter Bootstrap)?


title: Display message depending on capability outside loop

text: I want to display a unique message on the post (single.php) page **outside the loop** on author box. I want the message to be different depending on the author's capabilities. So for instance, if the author can `manage_options` then echo `this is admin`, else if the author can `edit_others_posts` then echo `this is editor` and finally else `this is contributor`.


title: has_excerpt yields true but no post_excerpt when retrieved

text: echo has_excerpt($att); //Results in True     echo $att->post_excerpt; // results in empty.     echo $att; // results "782" which is the ID of the attached image.      If I use `get_post_meta( $att , '_wp_attachment_image_alt', true)` I get the alternate text but I can't seem to retrieve the caption via `$att->post_excerpt;`.


title: How to make an interface similar to multi-site for switching between multiple (single) sites for administrators?

text: I have a few WordPress sites and I want to make it easier to manage. I was thinking of being able to switch sites in the dashboard like WordPress multi- site, but when I was looking into it I see that's only for blogs inside blogs (if that makes sense). Is there anyway to link to different blogs together (I have around 5 blogs all with content on them so I don't want to make them in to 1 site with mapped domains). So to sum up, I want to make it really easy/fast to switch between sites for the admins. I like how WordPress multi-site does it, but I don't want to move all the blogs in to one and map the domains, the domains are all on 1 server. Is this at all possable and if so how? Are there any plugins? EDIT: If there is no way, how would I make 6 single WordPress sites into a WordPress multi-site?


title: Displaying Posts Related to Other Posts by a Taxonomy Term?

text:
I have a custom post type for musician's profiles, and a taxonomy for their location (categorised hierachically into Countries and then Cities). On the musician's individual profile pages I need to display a list of musicians in the same city (i.e. the child taxonomy). It'd also be good to display posts in the same country seperately (the parent taxonomy). The problem seems to be retrieving the taxonomy dynamically, seperating the parent and child taxonomies and using these in a new loop. I can display a list of the taxonomies, and strip out the links...               $terms = get_the_term_list( $post->ID, 'locations', '', ', ', '' ) ;     echo strip_tags($terms);      ... which returns a result like this: New York, USA And I can easily loop through posts by a fixed taxonomy value...               <?php $my_query = new WP_Query( array( 'locations' => 'new-york', 'showposts' => 10 ) ); ?>     <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
     <?php endwhile; ?>      But I am having problems combining the two: as far as I can tell 'get_the_term_list' doesn't have the ability to return only one taxonomy, and there doesn't seem to be a taxonomy equivalent of 'get_the_category'. Any help much appreciated!!!


title: List category posts - thumbnail_size problem

text: I'm using the list category posts plugin, and can't get the thumbnail_size parameter to work with a given pixel size. The parameter can be a word, but also a size in X- and Y-dimension, as I understand it. Can someone give me an example of how to write this? Thanks.


title: 404 Error on Custom Post Type even after permalink flush

text: This is what my code looks like:               add_action( 'init', 'create_my_post_types' );          function create_my_post_types() {         register_post_type( 'competitor_claims',                            array(                                  'labels' => array(                                                   'name' => __( 'Competitor Claims' ),                                                   'singular_name'  => __( 'Competitor Claim' )                                                   ),                                  'public' => true,                                  'show_ui' => true, // UI in admin panel                                  '_builtin' => false, // It's a custom post type, not built in!                                  '_edit_link' => 'post.php?post=%d',                                  'capability_type' => 'post',                                  'menu_position' => 20,                                  'hierarchical' => true,                                  'query_var' => true,                                  'supports' => array(                                                      'title',                                                      'editor',                                                      'excerpt',                                                      'custom-fields',                                                      'thumbnail',                                                      'page-attributes'                                                      ),                                  'rewrite' => array(                                                     'slug' => 'claims',                                                     'with_front' => false                                                     ),                                  // Add taxonomies...                                  'permalink_epmask' => EP_PERMALINK                                       )                            );     }


title: Moved to a new server, backup was a day old and missing 3 posts, anyway to recover them from old host?

text: I made a backup for my clients site the other night, apparently after I made the backup they made a few posts. I then moved the site to another host and resetup wordpress and imported the database and backup files. Now my question is, I still have access to the old host, I can login via FTP or cPanel, is there anyway I can grab the posts from the database possibly? In phpMyAdmin? Thing is I cant just login since the nameservers are changed. Thanks, Matt


title: If Meta Checkbox is checked, do something?

text: I created a custom checkbox that when I check, I wish it to display slightly different content (specially special css styling). For some reason it is not functioning properly. In my functions:               add_action( 'add_meta_boxes', 'add_special_checkbox' );     function add_special_checkbox()     {         add_meta_box( 'special-checkbox', 'Special Box', 'special_checkbox_func', 'post', 'side', 'high' );     }          function special_checkbox_func( $post )     {         $values = get_post_custom( $post->ID );         $check = isset( $values['special_box_check'] ) ? esc_attr( $values['special_box_check'][0] ) : '';         wp_nonce_field( 'my_special_box_nonce', 'special_box_nonce' );         ?>         <p>             <input type="checkbox" name="special_box_check" id="special_box_check" <?php checked( $check, 'on' ); ?> />             <label for="special_box_check">Is this post 'special?'</label>         </p>         <?php        }               add_action( 'save_post', 'special_checkbox_save' );     function special_checkbox_save( $post_id )     {         // Bail if we're doing an auto save         if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;              // if our nonce isn't there, or we can't verify it, bail         if( !isset( $_POST['special_box_nonce'] ) || !wp_verify_nonce( $_POST['special_box_nonce'], 'my_special_box_nonce' ) ) return;              // if our current user can't edit this post, bail         if( !current_user_can( 'edit_post' ) ) return;              // now we can actually save the data         $allowed = array(              'a' => array( // on allow a tags                 'href' => array() // and those anchords can only have href attribute             )         );              // This is purely my personal preference for saving checkboxes         $chk = ( isset( $_POST['special_box_check'] ) && $_POST['special_box_check'] ) ? 'on' : 'off';         update_post_meta( $post_id, 'special_box_check', $chk );     }     ?>      In my loop:               <?php if (get_post_meta($post->ID, 'special_box_check', true)) { ?>     //add special styling     <? } else { ?>     //dont add special styling     <?php } ?>      When I save some posts, they have the special styling even though I did not check the box for them. And when I uncheck a box, I'd like the special styling to go away, but it is not when the box is unchecked. I am sure I am doing something wrong here. Thanks in advance.


title: User Training Materials

text: Does anybody know of any good publicly-available Wordpress training materials (videos, manuals, etc.) that could be used to give content editors a basic overview of Wordpress. We have a a handful of blogs on a Wordpress server and I'd really like to be able to automate training some more.


title: How can i call an article from each category and still paginate properly?

text:
I want to have my front page, with three columns, each assigned to a different category. Ideally I would like to query to fetch one post, per column, per page where possible, leaving the column empty if not. My current loop simply gets 3 posts at a time. It is reasonable to assume that the 3 will not be one of each category. Here is the loop:               <?php                      global $query_string;                 parse_str( $query_string, $my_query_array );                 $paged = ( isset( $my_query_array['paged'] ) && !empty( $my_query_array['paged'] ) ) ? $my_query_array['paged'] : 1;                 query_posts('post_type=post&posts_per_page=3&paged='.$paged);                           if ( have_posts() ) : while ( have_posts() ) : the_post();                      $category = choose_one_category(get_the_category());                      switch ($category){                     case "Festival News":                         $left[] = $post;                         break;                     case "Industry News":                         $centre[] = $post;                         break;                     case "Other":                         $right[] = $post;                         break;                 }                           endwhile;                  ?>

<?php previous_posts_link('« Previous') ?>

<?php next_posts_link('Next »') ?>

                 <?php endif;                                ?>


title: Reverting from a newer version of wordpress to an older version

text: For some reasons I need to degrade `wordpress` version of a site(I understand that it is **not** a **good practice** to do and I can fall into many troubles by doing so) but I still need to do it for some reasons. I want to degrade from `3.0` to `2.9`.I tried to upload the `wp-admin` folder of `wordpress 2.9` installation into my `wordpress 3.0` site but it was unable to load all the files. I can not delete the upgraded version as it contains images of posts. Is there any way to revert back to 2.9? Moreover, is there a plugin that can get this done? Thanks in advance.


title: $wp_query->max_num_pages

text: I have a pbd-ajax-load-posts plugin, and I'm using the portfolio. But `$wp_query->max_num_pages` is 0 - why? My `pbd-ajax-load-posts.php` code is:               <?php     /**      * Plugin Name: PBD AJAX Load Posts      * Plugin URI: http://www.problogdesign.com/      * Description: Load the next page of posts with AJAX.      * Version: 0.1      * Author: Pro Blog Design      * Author URI: http://www.problogdesign.com/      */          /**      * Initialization. Add our script if needed on this page.      */     function pbd_alp_init()     {         global $wp_query;              $pagina = get_post( $post )->post_name;              // Add code to index pages.         if( $pagina == 'our-portfolio' ) {                   // Queue JS and CSS             wp_enqueue_script(                 'pbd-alp-load-posts',                  plugin_dir_url( __FILE__ ) . 'js/load-posts.js',                  array('jquery'),                  '1.0',                  true             );                  wp_enqueue_style(                 'pbd-alp-style',                 plugin_dir_url( __FILE__ ) . 'css/style.css',                 false,                 '1.0',                 'all'             );                  // What page are we on? And what is the pages limit?             //$max=6;                  $max = $wp_query->max_num_pages;                  $paged = ( get_query_var('paged') > 1 ) ? get_query_var('paged') : 1;                  // Add some parameters for the JS.             wp_localize_script(                 'pbd-alp-load-posts',                 'pbd_alp',                 array(                     'startPage' => $paged,                     'maxPages' => $max,                     'nextLink' => next_posts($max, false),                     'linguaCorrente' => qtrans_getLanguage()                 )             );         }      }           add_action('template_redirect', 'pbd_alp_init');      ?>


title: Saving meta box data?

text:
All I really want is for the meta box data to be saved A) as an accessible global variable inside the loop and B) to save the data to the textbox so that when the user presses update what they have written appears in the textbox once updated. Currently, i know it doesn't fit the criteria for B), and I'm not sure whether or not it is accessible as a global variable in the loop. Any help?               add_action( 'add_meta_boxes', 'testimonial_text_box' );          function testimonial_text_box() {         add_meta_box(              'testimonial_text_box',             __( 'Testimonial Text:', 'myplugin_textdomain' ),             'testimonial_text_box_content',             'testimonial',             'normal',             'high'         );     }          function testimonial_text_box_content( $post ) {         $values = get_post_custom( $post->ID );           $text = isset( $values['my_meta_box_text'] ) ? esc_attr( $values['my_meta_box_text'][0] ) : ”;           $selected = isset( $values['my_meta_box_select'] ) ? esc_attr( $values['my_meta_box_select'][0] ) : ”;           $check = isset( $values['my_meta_box_check'] ) ? esc_attr( $values['my_meta_box_check'][0] ) : ”;                wp_nonce_field( plugin_basename( __FILE__ ), 'testimonial_text_box_content_nonce' );       $value = get_post_meta( $post->ID, '_my_meta_value_key', true );       echo '';            _e("Text body of the testimonial:", 'myplugin_textdomain' );       echo ' ';         echo '
';       echo '<textarea align="top" id="testimonial_text" name="testimonial_text" value="'.esc_attr($value).'" style="width:100%;height:200px;margin:5px -20px 3px 0;" /></textarea>';     }          add_action( 'save_post', 'testimonial_text_box_save' );     function testimonial_text_box_save( $post_id ) {              if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )          return;              if ( !wp_verify_nonce( $_POST['testimonial_text_box_content_nonce'], plugin_basename( __FILE__ ) ) )         return;              if ( 'testimonial' == $_POST['post_type'] ) {             if ( !current_user_can( 'edit_page', $post_id ) )             return;         } else {             if ( !current_user_can( 'edit_post', $post_id ) )             return;         }         $testimonial_text = $_POST['testimonial_text'];         update_post_meta( $post_id, 'testimonial_text', $testimonial_text );     }


title: Check if value is a custom taxonomy category name

text: I'm needing to check a variable and if the slug doesn't match a custom taxonomy's category slug run a function. I can't wrap my head around what I would need to do in order to get the "categories" of a custom taxonomy in an array and check them against a value. All help is greatly appreciated.


title: How do I get posts by multiple post ID's?

text: I've got a string with post ID's: `43,23,65`.   I was hoping I could use `get_posts()` and use the string with ID's as an argument. But I can't find any functions for retrieving multiple posts by ID. Do I really have to do a `WP_query`? I've also seen someone mention using `tag_in` - but I can't find any documentation on this.


title: Stepping up my game with Wordpress hosting

text: I'm reaching a point where my clients are demanding robust hosting, but I have little experience of what to offer. I've always dealt with shared hosts like Hostgator, but now that I'm building more service-based sites and mission- critical sites like ecommerce sites, I'm realising that shared just doesn't cut the mustard. Moreoever, I'm developing a website for selling library music online, so I need to know what my options are / should be for hosting on a solid platform. I've read the information here: http://codex.wordpress.org/High_Traffic_Tips_For_WordPress And I'll try WP Super Cache on my music site (which is currently on Hostgator's shared hosting) and I believe the speed of my MySQL queries are probably going to be the real strain on the server and affect speed for anyone searching for music. So my question is what I'd need for sites where the traffic could potentially hit around 5-10,000 hits per day (I know that might seem high, I'm just trying to get an idea). From what I've seen, VPSs and dedicated servers are a lot of work to maintain (for this music site, I have limited resources) so I'm thinking cloud-based scaleable hosting might be the way? If anyone can suggest how I might prepare for high-traffic scenarios in the most economical way, I'd be highly appreciative. Many thanks Osu


title: Change type of permalinks on TinyMCE link dialogue

text: I recently ran into a problem when inserting text links into post content, and then updating the target post's slug or changing permalink options - the link in the post content won't get updated. This is only really an issue if you forget where you've put text links to other posts, and so don't update them. So I hit on the idea of somehow altering the Link dialogue in TinyMCE to use shortlinks instread of inserting the full permalink: so `example.com/mypage/somepage` would instead be inserted as `example.com?p=123` This way the content links wouldn't need updating unless you trashed the target post. Does anyone have an idea on how to acheive this - I was hoping there would be a filter for the page results in the link dialogue?


title: Delete post media except featured image

text: I'm working on site where post except 'featured image' has also other images. Under certain circumstances I need to delete all images except 'featured image'. Which one the most convenient way to do it? Is it possible to do via `delete_post_media()` function or I should write custom query? Thanks.


title: Using paginate_links() to generate "1, 2, 3 ... 10, 20, 30, 40... 55" paginations

text: I found this code :                   // Get total number of pages         global $wp_query;         $total = $wp_query->max_num_pages;         // Only paginate if we have more than one page         if ( $total > 1 )  {              // Get the current page              if ( !$current_page = get_query_var('paged') )                   $current_page = 1;              // Structure of “format” depends on whether we’re using pretty permalinks             $permalinks = get_option('permalink_structure');             $format = empty( $permalinks ) ? '&page=%#%' : 'page/%#%/';             echo paginate_links(array(                   'base' => get_pagenum_link(1) . '%_%',                   'format' => $format,                   'current' => $current_page,                   'total' => $total,                   'mid_size' => 2,                   'type' => 'list'             ));         }      It works ok but it generates pagination like "1, 2, 3 ... LASTPAGENUMBER", I've seen plugins that generate paginations like this "1, 2, 3... 19, 20, 30 ... LASTPAGENUMBER". Can this be achieved using paginate_links() function? I don't want to add a plugin just for this small tweak.


title: Recommended sidebar / content widths

text: I'm developing my own theme. Does WordPress recommend or require a minimum or maximum when it comes to the width of the content or sidebar elements of an post, page or archive page? If not, are there any unofficial guidelines?


title: Dropline menus -- seperators between children only?

text: I'm working on a custom dropline menu using wp_nav_menu. Using `wp_nav_menu( array( 'theme_location' => 'primary', 'after' => '|' ) );`, I can put separators after every item. However, I'm only wanting them after the child items in the sub-menu. Is there any way I can be more specific about which items have separators, such that only the non-parent items are separated? Thanks!


title: TwentyTwelve child theme: Incorrect footer menu

text: I built a child theme of Twenty Twelve, and created a menu called "Footer Menu" in Appearance > Menus. I assigned this menu to the Footer location: ![enter image description here](http://i.stack.imgur.com/TCqX8.png) However, the footer menu in the live site displays the same menu as Primary Menu. I have not changed footer.php:               <footer id="colophon" role="contentinfo">         <div>             <?php wp_nav_menu (array ('theme_location' => 'Footer', 'menu_class' => 'footer-menu' )); ?>         </div>              <div class="site-info">             Copyright © Brinkley & Chesnut         </div><!-- .site-info -->     </footer><!-- #colophon -->      Why is the wrong menu displaying in the footer? **Update** functions.php contains:               function register_my_menus() {         register_nav_menus (             array ('footer-menu' => __ ('Footer'))         );     }      I changed "Footer" to "footer" in both functions.php and footer.php, but the issue remains.


title: How to create custom user input field and display multiple field values on another page

text: I would like to allow logged-in readers to submit input through custom fields displayed in posts. There would also be a page that displays all the user's values inputted through the various fields. The ACF plugin doesn't seem to work because the custom field is added at the post author level rather than within the published post that the reader views. For example, a post might tell a story, then ask the user to input what he learned from the story. Another post might teach a principle, then ask the user to input what plan he has made based on that principle. Then the user can go to a page that displays all of that user's (and only that user's) responses.


title: How to noindex for certain custom post type without using plugins..?

text: Is there a way to create a noindex (meta robot ) for certain custom post type that i have for my wordpress blog..? Thanks


title: Next and Previous buttons are not showing on home page for post

text:
I made a theme from PSD to WordPress but the "next"-"previous" buttons are not showing on home page. Here is the code of `single.php`:

                      <?php while ( have_posts() ) : the_post(); ?>                          <?php get_template_part( 'content', get_post_format() ); ?>
<?php _e( 'Post navigation', 'aquaponicfamily' ); ?>
                         <?php previous_post_link( '%link', '' . _x( '←', 'Previous post link', 'aquaponicfamily' ) . ' %title' ); ?>                         <?php next_post_link( '%link', '%title ' . _x( '→', 'Next post link', 'aquaponicfamily' ) . '' ); ?>                                               <?php comments_template( '', true ); ?>                      <?php endwhile; // end of the loop. ?>

          <?php get_sidebar(); ?>     <?php get_footer(); ?>      What the changes are required?


title: Why is my database import losing text widget data?

text: I've created a site in WordPress on our development machine. In the theme we're using there are numerous widget zones to display text in (sidebar and front page). I've used simple Text widgets in all of these zones to put our display information. When I migrated the site to production, I used the WP-DB-Backup plugin to take a snapshot of the database. I then edited the resulting .sql file to update all of the file paths and URL references to point to our production site. After creating the database, website, and copying all of the files over to the production site, I run the .sql file from the mysql command prompt to import the data into the new database. However, when I go to the production site, some of the text shows up and some of it doesn't. When I look into the widgets section of the site, the text widgets are missing from some of the widget zones. The text widgets aren't even visible in the "Inactive Widget" zone, they simply aren't there. I've even tried to repeat the process using the BackWPup plugin, noticing that the SQL syntax is different when it dumps the database out. Why am I losing text widget data during the import?


title: More link - not text

text: I am using origin theme. This theme writes dots in post end. In functions.php file I saw line with text:               function origin_excerpt_more( $more ) {          return '...';      I changed text to **More...** and instead of dots text changed. I want that text **More...** change to link **More...** And link would be to the post. How do I change this code? My website is popietevirtuveje.lt


title: a child theme not de-registering a patent javascript file

text: We're currently rolling out a number (>100) of wordpress sites where we're using a custom child theme and a holding page plugin. Most of our clients use IE8 as their browser (corporate policy) and unfortunately their appears to be a conflict between the holding page plugin and an external javascript file included by the parent theme, set in it's functions.php file.               wp_register_script('iejs', 'http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js');      I've tried to prevent the JS file from being called by adding               wp_deregister_script('iejs');     wp_dequeue_script('iejs');      N.B. I guess using but deregister and dequeue is overkill but I want to be sure I've de-registered it... to the child theme functions.php but that didn't work (prevent the javascript file being called by wp_head), I read somewherre that child themes are called pre the parent theme so I tried               function SAH_dereg() {         wp_deregister_script('iejs');         wp_dequeue_script('iejs');     }     add_action( 'after_setup_theme', 'SAH_dereg' );      to force it to de-register the script after the theme loads but before it displays, but that didn't work either. We could of course just remove the line from the parent theme and ignore any updates until after we've sign off from our clients. But I'd prefer a more elegant solution.


title: Exclude posts without category from loop

text: I'm trying to exclude all the posts that doesn't have a category assigned to from the main loop, i searched everywhere and i found a billion ways to exclude some categories or filter from specific category but not what i need to do, is it possibile?


title: How to add relationships between custom post types?

text: Let's say i have a sample post called "avatar" in "movie", "trailer", "review" and "details" custom post types. How can i display in the "movie" custom post type the content + links to "trailer", "review" and "details" custom post types ?


title: How to show only terms by id or slug on edit-tags.php (custom taxonomy manage page) for a custom taxonomy

text: How can I show only terms by id or slug on edit-tags.php (custom taxonomy manage page) for a custom taxonomy. I am saving term_owner metadata to a table for each term and getting all terms' ids for a specific term_owner. Now I want to show only these terms on edit-tags.php. I have tried list_terms_exclusions filter but seems it doses not work for edit-tags.php?taxonomy={custom_taxonomy_name} or I am missing something. Can anyone help me with a working exapmle? Thanks you.


title: Closing ajax function file with die() causes error and empty page

text: Adding `die();` to the end of my ajax function file gives me totally blank page and this error in Firebug: `The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must to be declared in the document or in the transfer protocol.` I scaled down to a very basic ajax function file:               <?php     function show_article(){     $q = $_GET['getid'];          echo strval($q);     }          die();     ?>      Which still gives the empty page and error. Without `die();` at the close, it works as expected but with the extra 0 at the end of the echoed $q value. I'm not sure what is causing this issue. For extra context, here's what I've got in my functions.php file.               function ajaxscripts() {     wp_enqueue_script( 'productajax', get_template_directory_uri().'/js/productajax.js', false, null, false );       wp_localize_script( 'productajax', 'myajax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );     }     add_action('wp_enqueue_scripts', 'ajaxscripts');          $dirName = dirname(__FILE__);     $baseName = basename(realpath($dirName));     require_once ("$dirName/getarticle.php"); //my ajax function file          add_action( 'wp_ajax_nopriv_show_article', 'show_article' );     add_action( 'wp_ajax_show_article', 'show_article' );


title: Displaying posts from a Category where the Category ID or slug is not known

text: This may be a really simple question but I've struggled to find an answer either searching here, WP forum or via Google. I have a number of different categories and I would like to use just category.php. At the moment I have to create a thecatname-category.php page for each category but this is not very efficient as my I would have to create a new one every time a new Category was created. So I need to find a workable solution that will display all posts from a selected Category where the category ID is passed to category.php and then display posts from that Category. Hope that makes sense! Thanks, Kev


title: How do you modify the 'post_parent' of a custom post type?

text: I want to be able to edit the post_parent of a custom post type. Basically in my use case I want to mimic how WordPress uses attachments: have a custom post type that is sort of a subtype to post or any other post type. WordPress uses the post_parent field on the wp_posts table to link attachments to their parent posts so I want to be able to do the same. I've tried to use wp_update_posts but it seems to time out the connection when I try to call it during a post save. Is there a way of editing the post_parent directly?


title: Getting top Image From the Gallery and printing out a thumbnail with Exact Dimensions

text: I'm looking for a plugin that pulls an Image from a Wordpress Posts Gallery (Note NOT the Featured Thumbnail, we have thousands of posts and can't retroactively go back and set a Featured image for each post..) Also some of the plugins I've tested don't let you specify exact dimensions, the Wordpress Get The Image Plugin let's you pull an image from the gallery like I want then you set the width but it tries to maintain proprotions. So basically I need it to do exactly that except not try and maintain proportions but rather do a Zoom Crop if that makes sense.


title: get_plugins() doesn't work after plugins_loaded

text: Any idea why the following code               function my_plugin_load()     {         get_plugins();     }     add_action( 'plugins_loaded', 'my_plugin_load' );      Throws this error? > **Fatal error** : Call to undefined function get_plugins() Shouldn't `get_plugins()` be defined after the `plugins_loaded` hook is fired? If not, what would be the proper hook to call? (This hook should initiate the plugin's bootstrap/load process)


title: Modify loop but keep the original query, what am I doing wrong?

text:
I have a custom post type where I have a taxonomy `cities` and a term `berlin`. Archive can be seen at `example.com/cities/berlin` and it's rendered normally from the `archive.php` template. Now, I want to order them according to a custom field, `start_date` in this case, but still keep the original query around. So that when I navigate to `example.com/cities/newyork` the loop would still work as expected. This is what I have but I only get the `<p>Not Found</p>` in the end. Please help. Thanks :)               <?php     global $query_string; //to keep the original query around     $args = array(       'orderby'  => 'meta_value_num',       'meta_key' => 'start_date',       'order'    => 'DESC'     );     $posts = query_posts($query_string . $args);     if (have_posts()) : while (have_posts()) : the_post();      ?>          do stuff          <?php endwhile; else : ?>
Not Found
     <?php endif; ?>


title: How could I execute my plugin just in frontend (not in backend)

text: I don't need my plugin running through wp-admin, including wp-login. How could I prevent it? is_admin works fine but i don't know how to ignore everything related to wp-admin (like wp-login.php). Thanks.


title: wpquery via ajax

text: I can reload my page and have php write a new **wpquery** and replace the content on my page, but I really don't want to deal with a new page load. Is there an _easy_ way to send a **wpquery** string (eg `"p=7"`) via **ajax**? Even if I have to make a custom php page to query, that's fine. I'm still new to wordpress so I wanted to make sure there's no easy way to do this before I start taking the "scenic" route. **Thanks.**


title: Conditional tag to determine if the user is viewing the Add Media (after clicking Add media button)

text: Is there a WordPress conditional tag for checking if the user is viewing the add media popup after clicking the Add media button? If none, is there an alternative function that can be used? Thanks for any tips and advice.


title: How to change templates based on URL

text: Okay, so here's what I'm trying to do but having a hell of a time figuring out. I've got a website that uses the MemberPress plugin. All of those pages by default use the standard default template for each of their dynamically generated pages (i.e. thank you page, checkout page, account page, etc.). Furthermore, these pages are dynamically generated and can not be edited from the admin section to use whatever template you want. So, all of the pages I am trying to change the template for have one thing in common, they all have a URL that has /register/ in it (i.e. www.mywebsite.com/register/page-name-here/. Now I checked through all of the WordPress function references at the bottom of the page here... http://codex.wordpress.org/Function_Reference/is_page I don't see anything I can use to determine if a page URL has /register/ in it but I would like to have some sort of code that I could put within my page.php default template that those pages use. The code would simply say something like... if URL contains /register/ DO NOT include sidebar. Else include sidebar. So in other words, the register pages would not include the sidebar and any other pages would include the sidebar. Make sense?


title: Using wp_handle_upload() to direct specific path by using $overrides

text: How do you use `wp_handle_upload` function and `apply_filter` together to upload files on a specific path? What is going to be the override? For example:               $overrides = array('file' => 'C:\\uploads\\filename.pdf','message' => 'File written');     apply_filter('wp_handle_upload',$overrides);      or something like that? Or is this the right code? **The real question in here is: what $overrides can be used as the key to this associative array?**


title: The plugin generated XXX characters of unexpected output...help?

text: I am working on a plugin that creates a custom post type and then creates a custom template file for the activated theme. The plugin is done editing. But I've received an error while uploading that says "The plugin generated 265 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin." Here is the code for the main file: http://pastebin.com/jztzG499 What can I do to solve this problem? I have looked through other sites and Stackexchange but none of them were helpful. Please help.


title: Adding custom image sizes and post types to a plugin or to a theme?

text: I'm just getting started but want to play around in the right area practicing for a new personal site/theme. Part A: I want to add featured images (and a few new image sizes) to a blog portion of a theme. It feels like all this should be done in the child theme itself, right? Part B: I also want to add a portfolio page template with associated custom post type. (in a custom, plugin, correct?) Would it be ok to still include the page template in the theme? Just looking for the best locations to add this, not the code itself.


title: Multiple Query_Posts

text:
I am trying to put a query_posts inside a WP_query. Anything after my query_posts doesn't work properly. Here is my code. What am I doing wrong?               <?php         $args = array( 'post_type' => 'product', 'posts_per_page' => 1, 'product_cat' => 'featured' );         $loop = new WP_Query( $args );         while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>

The Latest Issue

             <?php              if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.               the_post_thumbnail();             }              ?>

<?php the_date(); ?>

<?php the_title(); ?>
                 <?php the_content(); ?>
What's Inside:

                 <?php query_posts( array ( 'category_name' => 'Magazine Preview', 'posts_per_page' => 3 ) ); ?>                 <?php while (have_posts()) : the_post(); ?>
                     <a href="<?php $featuredImage = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );  echo $featuredImage;?>" rel="lightbox" title="">                     Photo Preview
                     <?php the_title(); ?>
                 <?php endwhile; ?>

Available Now.
                 For Free.
                      <a href="<?php echo get_post_meta( get_the_ID(), 'magazine_url', true ); ?>" class="button read-it" target="_blank">Read It                  <?php echo get_post_meta($post->ID, 'magazine_url', true); ?>

          <?php endwhile; ?>


title: Change Twenty Twelve's comment form in a child theme

text: I have a custom child theme of Twenty Twelve. I want to change the text "Leave a reply" to "Leave a comment", and also remove the website field from the comments form. How can I do this? Thanks.


title: How to handle large number of images in a post?

text: I have a load of images - up to 16 per post plus a thumbnail and a logo. I want to figure out what the best way to handle them is. Since I'll be adding new entries quite regularly the number of images in the default uploads directory will get quite large. Is this something I should be concerned about? As far as load times etc. I was going to create a co-gallery post type and attach the gallery images to this post type. Then set the gallery id on the Company edit page ( different post type ) to which the gallery belongs. A little code and I have an image gallery. Or should I consider ( ad figure out how to ) uploading the images to a completely separate location/directory? Would doing this be worth the effort and is it really beneficial? Hope that makes sense. Thanx for your help.


title: Pagination that includes "view all on one page"

text:
I'm using the code below to create pagination for my post results, it works fine but is it possible to add a "view all posts on one page" button to the pagination? This would presumably override the pagination code and just display everything all posts on one page.               function numeric_pagination ($pageCount = 9, $query = null) {          if ($query == null) {         global $wp_query;         $query = $wp_query;     }          if ($query->max_num_pages <= 1) {         return;     }          $pageStart = 1;     $paged = $query->query_vars['paged'];          // set current page if on the first page     if ($paged == null) {         $paged = 1;     }          // work out if page start is halfway through the current visible pages and if so     move it accordingly     if ($paged > floor($pageCount / 2)) {         $pageStart = $paged - floor($pageCount / 2);     }          if ($pageStart < 1) {         $pageStart = 1;     }          // make sure page start is      if ($pageStart + $pageCount > $query->max_num_pages) {         $pageCount = $query->max_num_pages - $pageStart;     }          ?>
     <?php     if ($paged != 1) {     ?>     <a href="<?php echo get_pagenum_link(1); ?>" class="numbered page-number-first">  ‹ <?php _e('Newest', 'rhinoplasty'); ?>     <?php     }     // first page is not visible...     if ($pageStart > 1) {         //echo 'previous';     }     for ($p = $pageStart; $p <= $pageStart + $pageCount; $p ++) {         if ($p == $paged) {     ?>         <span class="numbered page-number-<?php echo $p; ?> current-numeric-page"><?    php echo $p; ?>     <?php } else { ?>         <a href="<?php echo get_pagenum_link($p); ?>" class="numbered page-number-<?    php echo $p; ?>"><?php echo $p; ?>          <?php         }     }     // last page is not visible     if ($pageStart + $pageCount < $query->max_num_pages) {         //echo "last";     }     if ($paged != $query->max_num_pages) {     ?>         <a href="<?php echo get_pagenum_link($query->max_num_pages); ?>" class="numbered page-number-last"><?php _e('Oldest', 'rhinoplasty'); ?> ›     <?php } ?>
          <?php }      I'm not really sure how to go about doing this, any suggestions would be greatly appreciated. Changing to different pagination code is also fine if that will work better. Just to clarify my question, I want to add a 'view all posts on one page' functionality, basically over-riding the pagination code - this would be done by clicking a "view all" link to the right of the pagination menu ( 4 5 ... last Next >> View All> ). Update - almost there I think: I've added this:               <?php      $Path=$_SERVER['REQUEST_URI'];     $URI='http://sitename.com'.$Path;     $nopage = add_query_arg( 'paged', 'no', $Path );     ?>          <a href="<?php echo $nopage; ?>">View All      Which reloads my page with sitename.com?paged=no, but it still shows pagination - I'm not sure how to override the pagination. UPDATE: Here is how I ended up solving it in case this helps anyone else. After the above code and before the final I added:               if (isset($_GET['viewall']))          {          function view_allposts( $query ) {              $query->set( 'posts_per_page', -1 );          }          add_action( 'pre_get_posts', 'view_allposts' );          }               if(!$_GET['viewall']){ ?>          <a class="numbered" href="<?php  echo add_query_arg( array( 'viewall' => "true" ), get_pagenum_link(1) ); ?>">Show All >>          <?php } ?>      Works perfectly! Thanks for your help on this Kaiser, although I used a different solution I learned a lot from the links you provided.


title: Removing title tags from each page

text: hello to all I am newbie to wordpress. I want to remove the title tags from every page.Is there any way to remove that part?Thanks in advance..


title: Remove portion of header code from home page only

text: I have this code in the template file `header.php`:               <div class="dynamic-header">         <?php if(function_exists('show_media_header')){ show_media_header(); } ?>     </div>      I want to process that header info on all pages, except for homepage. How I can do this?


title: How can I add Menu Page to specific user?

text: I've installed a plugin for my client called uTubeVideo, but he has a user role of editor so the option page of the plugin won't display for him. Initially, i thought I could fix this using the `if( current_user_can('editor'))` and adding the page using `add_menu_page();`. This because I already had limited his backend using this function:               add_action('admin_init', 'my_remove_menu_pages');          function my_remove_menu_pages()     {         global $user_ID;         if (current_user_can('editor')) {             remove_menu_page('edit.php?post_type=slide'); // Slides             remove_menu_page('edit.php?post_type=portfolio'); // Portfolio             remove_menu_page('edit-comments.php'); // Comments             remove_menu_page('plugins.php'); // Plugins             remove_menu_page('themes.php'); // Appearance             remove_menu_page('users.php'); // Users             remove_menu_page('edit.php'); // Posts             remove_menu_page('tools.php'); // Tools         }     }      Sadly I can't get this to work, does anyone know how I can fix this?


title: Retrieve WordPress' the_content() with jQuery

text: I'm trying to load some additional images when the user clicks a button. At the moment, I have the following function:               $('a').click(function(){         $( ".gallery-pop-up-container" )         .load( "wp-content/themes/fashion_detail/includes/single/gallery-pop-up.php");     });      and I'm trying to load:               <div class="gallery-page">         <?php the_content(); ?>     </div>      However, I get a PHP error, because it's not sure what the function is:                Fatal error: Call to undefined function the_content()       What would be the best way for me to load `the_content()`?


title: How to have multiple sections within the same theme options page

text: For my theme, I have created a Settings Page which is shown in the Appearance menu of Wordpress admin. Now, I have been following this tutorial. Exactly like the tutorial, I have created multiple sections and I face the issue where only the fields of the last section are saved in the DB while the fields of other sections are not saved. I do not want to go for the Tabbed Navigation option - I have too many sections. How do I solve the problem of not being able to save fields of other sections due to the nonce issue?


title: Wordpress Pretty Permalinks redirecting to home page on iis7

text: I have my WP site on iis7[Windows server 2008 R2];have explored a lot to find the right solution but nothing worked :( http://cricketclips.net/late-overs-batting-flurry-from-luke-wright-pepsi- ipl-2013-kxip-vs-pw-match-29/ My Url are being rewrite but are redirected to homepage instead of single.php and other pages ( that is index.php instead of single.php or other scripts) Added the following code to web.config in root               <?xml version="1.0" encoding="UTF-8"?>     <configuration>     <system.webServer>     <rewrite>     <rules>     <rule name="WordPress Rule" stopProcessing="true">     <match url=".*" />     <conditions>     <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />     <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />     </conditions>     <action type="Rewrite" url="index.php?page_id={R:0}" />     </rule>     </rules>     </rewrite>     </system.webServer>     </configuration>      but still it didn't work have checked the server for "FCGI" and "URL rewrite module", both are installed. Any help in this regard will be appreciated.


title: How do I Change the notification email via PHP for Gravity Forms Form?

text: I've built a Wordpress template file in my custom theme that displays a directory of members from a custom PHP file powered by a MYSQL database. This allows each member to be displayed on a different page displayed from this template. I want to display a contact form powered by Gravity Forms on each member page- all using the same Gravity Form. This way people can send an email to the member through that member's profile page and in a way that keeps their email address private. I was hoping to just use a shortcode but Gravity Form shortcodes does not give the ability to change the notification email address. I could use a Gravity Forms function, but how do I change the notification email within a function? The email address is already set as a PHP string but is set from a non- WordPress included file. I did research this question including at the Gravity Forms support forum but without success. One option recommended to me was to send the notification email address as a hidden field in the form. I want to avoid this because I want to keep this email private. There may be other options open to me but as I am new to Gravity Forms and WordPress I could do with some help! Thanks!


title: Multiple new posts using XML-RPC?

text: Is it possible to create multiple posts in one XML-RPC request? I've searched everywhere, but did not find any info. I suppose it isn't possible.


title: query_posts meta_key with current date

text:
How to query Post with current date month with custom field: Here is my code                   <?php         global $wp_query;         $event_month = get_post_meta($wp_query->post->ID, 'eventdate', true); //format in db 11/17/2010         $event_month = date("n"); //A numeric representation of a month, without leading zeros (1 to 12)         $today= getdate(); ?>              <?php query_posts('meta_key='.$event_month .'&meta_compare&meta_value=' .$today["mon"]);?>          <?php while (have_posts()): the_post(); ?>

<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="bookmark">             <?php the_title(); ?>
           <?php the_content(); //Display the content?>
     <?php endwhile; ?>     <?php wp_reset_query();?>      but it doesn't display the output.. .what I want to display is the event list for the month.. for example if it's November it will display the event list for November and when the month of December comes it will show the event list of December and so on.. . The event list date comes with custom field format like this 11/17/2010 compare to current date here are the additional expected output current date is November and the event list should be like this:               +-----------------------+-------------+     | Event Name            | Date        |     +-----------------------+-------------+     | ABC Market opening    | 11/18/2010  |      | ABC Market Seminar    | 11/25/2010  |      | ABC Market Promo      | 11/29/2010  |      +-----------------------+-------------+      thanks guys


title: WP Multisite: Adding pages on blog creation by default

text: I’d like to have a page added by default when a new site is created with WP Multisite. So I have my function that creates two pages:               function my_default_pages() {         $default_pages = array('Impress', 'Contact');         $existing_pages = get_pages();              foreach($existing_pages as $page) {             $temp[] = $page->post_title;         }              $pages_to_create = array_diff($default_pages,$temp);              foreach($pages_to_create as $new_page_title) {             // Create post object             $my_post = array();             $my_post['post_title'] = $new_page_title;             $my_post['post_content'] = 'This is my '.$new_page_title.' page.';             $my_post['post_status'] = 'publish';             $my_post['post_type'] = 'page';                  // Insert the post into the database             $result = wp_insert_post( $my_post );         }     }      And I found out that I have to hook into the `wpmu_new_blog`[1] action that fires when a new site is created.               add_action('wpmu_new_blog', 'my_default_pages');      But I don’t know how make both working together …


title: Formating the display of a post's date, outside the Loop

text: I'm using this function to be able to retrieve several data, from outside the Loop:               function get_post_data($postId) {      global $wpdb;      return $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE ID=$postId");     }      ... and then, this to display the date a post was published:               <?php      global $wp_query;     global $thePostID;     $thePostID = $wp_query->post->ID;     $data = get_post_data($thePostID);     echo $data[0]->post_date;     ?>      wich displays something like "2010-06-14 22:36:03" in my sidebar, but I'd like to format it like just "June, 2010" Can it be done?


title: site is loading fully zoomed in on mobile devices

text: my website is 980px wide. actually it is built on wordpress. My wordpress theme was initially responsive. Somehow i disabled its responsiveness. after that the website loads fine on desktop but it is loading 100% zoomed in on mobile and tablet devices. So my question is pretty simple. I just want to set the zoom level automatic for all types of devices. Thanks


title: Wordpress 3.6, searchform.php problems

text: I have just updated to wordpress 3.6 and my theme seems to be ignoring my searchform.php file. Has this happened to anyone else?


title: Stop WP from creating "Sample Page" and "Hello World!" post

text: Is it possible to stop WP from creating the "Sample Page" and "Hello World!" post when creating a new blog?