title: Mysql query LIKE not working

text: I'm using this code.               $blog_list = $wpdb->get_results( "SELECT " . $extra . "blog_id, last_updated FROM " . $wpdb->blogs. " WHERE public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted ='0' AND UPPER(blog_name) LIKE 'A%'" . $order . " " . $limit . "", ARRAY_A );      But that LIKE statement `AND UPPER(blog_name) LIKE 'A%'"` not working. Can anyone give me the solution? Thanks ## Update: Actually i'm using this code               $where = '';      if ($filter) {      $where = "AND UPPER(blog_name) LIKE '".strtoupper($filter)."%' ";      }      So i'll replace `AND UPPER(blog_name) LIKE 'A%'"` with `$where` later Note: I have 500+ blogs in my network. > I want to display all blog names with anchor link in a page. But I don't > want to load all the blog names. So I'm trying to achieve alphabetical > navigation. If the user click link "A" then the page should display Blog > names starts with "A". Likewise B, C, etc. Here is the full code if anyone interested


title: How to Send Group Name From MailChimp Plugin Sign Up Form

text: I am using the MailChimp WordPress plugin so that user's can sign up to a MailChimp mailing list. I want the signups to go into a specific group in my list. The plugin doesn't appear to work correctly with mailing list groups. Can I just dive into the plugin code and add a hidden field to force the users into a certain list? I tried digging around in there and it looks like the group is determined from an input called "interests". I have tried sending the form with a hidden field with this name having the value of the name of the group I want to use, like this:               <input type="hidden" name="interests" value="Group Name" />      But this does not work. Digging around on Google doesn't seem to offer much help either, as there only appears to be other confused users or not much interest in this particular aspect of the plugin. How can I do this?


title: In need of array of post tags

text: On the single-post page within the loop I need an array of the_tags() which is a string. and get_tags() gives me all of the tags not only this posts. Is there an easy way to get this?


title: how to get all the child category name in a specified category name?

text: Supposed the specified category name is "product", which has three layered sub-categories. The structure is like the following:   * product one      * product two        * product three          * product four I want to output all the subcategory names in the `sidebar.php` of my theme. How do I do? in my theme index.php i using: `<?php include("productHallofHome.php");?>` in productHallofHome.php i using code:               <ul class="productList_h">     <?php wp_list_categories( 'child_of=4&depth=0'); ?>         </ul>


title: how do i register global query in template

text: ok i think this is a basic php question but here goes: i have this working code:                 <!-- show the bands playing -->                                   <?php $child_posts = types_child_posts('my-intermediary');                                     foreach ($child_posts as $child_post) {                                     $band_id = wpcf_pr_post_get_belongs($child_post->ID,'album');                                         $band = get_post($band_id);                                         echo $band->post_title;                                         echo $band->the_post_thumbnail();                                                       }                                     ?>      what I want to do is access the $band->post_title; any where on the page so i'm guessing i need to cue this up globally on the page? adding this query to the header? so i would like to use some thing like `<?php echo $band(post_title); ?>` < example i hope that makes sense. thanks!


title: add image map script to post

text:
when i add this script to my post html editor :
          <map id="wordlmap" name="wordlmap">     <area shape="rect" coords="845,267,929,324" href="/australia" alt="australia" title="australia"/>     </map>
      after updating post, i only get:

        can someone help me please, thanks in advance


title: High CPU & Memory Spikes?

text: I randomly get high spikes in CPU and Memory. I have deactivated nearly all plugins trying to find the culprit. I have been turning on a few at a time then waiting 30 minutes to see how if the server says it is okay. Which it always does. I didn't touch it for 3 hours tonight and when I returned I realized that my VPS randomly spiked at around 8PM and 9PM. But from 6PM-8PM no issues and from 930PM-1230AM no problems. It says my issue is with index.php. This randomly started on the 26th. No new plugins, no script change, no difference at all. How do I figure out what the issue is? **More Info:**   I have two wordpress installations on my VPS. One of which is my main site that me and about 3 other people write on and the other is kind of like a picture site where you submit pictures and I approve them and they get posted. I have about 330 people on that site. The subdomain (picture site) is the one I am having issues with. It is not the theme index file that is causing the problem but the WP index file. Between the two websites I get about 500k views a month (more on the main site than the picture site) **Server info:**   * Disk Space: 100gb   * Memory: 2GB   * Burst: 2GB   * Bandwidth: 1.5tb   * OS: CentOS 5.5 with Cpanel   * IP: 2   * Proccessor info:      * 8 proccessors     * GenuineIntel     * Intel Core i7 CPU 870 @29.93 GHz     * Speed: 2933.46 MHz     * Cache: 8192kb **Plugins (Currently activated)**   * Advanced Random Posts,   * bbpress integration,   * Custom Post Templates,   * GD Custom Posts and Taxonomies Tools,   * GD Star Rating,   * Gravity Forms,   * Members,   * Ultimate Category Excluder,   * Wordpress.com Stats,   * WP-Paginate,   * WP-PostRatings,   * WP-PostViews, On that note, all of these and others were turned on and worked just fine. Then all of a sudden it went to heck. All plugins are updated and I have the most recent wordpress.


title: Check if post type has term

text: Okay guys, I have a problem. Tomorrow(today) I have a deadline but I'm stuck with a problem and it seems that I can't figure out how to do. I have a custom post type, called `articles`. I've also created a taxonomy called `subject`. Each article has a subject, just like posts have categories. Now to the problem. When I'm on the `page-articles.php` (`page-slug.php`), it has to check which subject the article has. How can I do that?! I've been surfin' the web for days without finding any solution. What I'm thinking is that in some way I have to check the taxonomy subject if it matches a criteria. Like:               if (is_term('news, 'subject'){     // do this     }      But I really can't figure out how it works! The `is_term` doesn't do that, and I can't find any other function either.


title: header, stylesheet not being read

text:
I'm working on a theme that doesn't seem to be reading the header and/or stylesheet. All of the code seems to check out correctly, so I'm a little confused as to why this is happening. Perhaps I've overlooked something. If you look at the live site, you can see that the loop/index.php is showing, but no header. header.php               <!DOCTYPE html>     <html <?php language_attributes(); ?>>                      <meta charset="<?php bloginfo( 'charset' ); ?>" />             <title><?php wp_title(); ?></title>             <meta name="description" content="<?php bloginfo( 'description' ); ?>">             <link rel="profile" href="http://gmpg.org/xfn/11" />             <link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>" type="text/css" media="screen" />             <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />             <?php if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); ?>             <?php wp_head(); ?>

<img src="<?php bloginfo('template_directory'); ?>/img/logo.png" alt="logo" />

SITE

ABOUT

CONTACT

SEARCH

      index.php               <?php get_header(); ?>      <?php get_sidebar(); ?>
         <?php if (have_posts()) : ?>               <?php while (have_posts()) : the_post(); ?>

<a href="" rel="bookmark" title="Permanent Link to                  <?php the_title(); ?>"><?php the_title(); ?>

<?php the_time('F jS, Y') ?>

             <?php the_content('Read the rest of this entry »'); ?>             <img src="<?php bloginfo('template_directory'); ?>/img/dots_small.png" class="divider" alt="post divider">             <?php endwhile; ?>

<?php next_posts_link('« Previous Entries') ?>

<?php previous_posts_link('Next Entries »') ?>

               <?php else : ?>
Not Found

Sorry, but you are looking for something that isn't here.
               <?php include (TEMPLATEPATH . "/searchform.php"); ?>           <?php endif; ?>
           <?php get_footer(); ?>


title: Is including the loop necessary for page.php?

text: **QUESTION:** Is it necessary to include the wordpress loop in page.php? If it is not necessary, why do many themes (including the wordpress 2013 default theme) include it? I noticed this discussion on the wordpress forums, but I didn't understand the final answer. furthermore it is stated, > You use The Loop in your template files to show posts to visitors. ( > **Source:**http://codex.wordpress.org/The_Loop_in_Action) **BACKGROUND:** I am attempting to develop special page templates, and I realized that I don't quite understand what the benefit is of including the loop for pages.php, because after all, pages don't care about posts, that is something that concerns index.php.


title: htaccess problem not being able to overwrite previous rules

text: so guys, what i need to do is: whenever someone ask for this url: dev.site.com/noticias/id/tittle-for-the-news ( dev.site.com/noticias/([0-9]+)/([A-Za-z0-9-]+)/ ) it needs to get this: dev.site.com/noticias/?_escaped_fragment_noticias=id/tittle-for-the-news so i go ahead and set this function (i've done some googlign for this but not quite sure if its ok)               function add_url_rewrite() {              add_rewrite_rule('noticias/([0-9]+)/([A-Za-z0-9-]+)/', 'noticias/?_escaped_fragment_=noticias=/$1/$2', 'top');     }     add_action( 'init', 'add_url_rewrite' );      but ofcoruse, this didnt work at all and that's why im here trying to find out.. how do i do an .htaccess rewrite rule for wordspress. thanks in advance!


title: CMS: Making complex pages editable by the end user

text: I have been tasked with re-creating a small-ish corporate Web site (maybe a dozen static pages and a blog section) using WordPress. I have no troubles with the actual Web design, nor with the PHP itself. However, i am struggling to figure out how to set it up so that end users can edit the static pages with more complex layouts without HTML knowledge. For instance, the front page of this site will use the incredibly familiar pattern of a Jumbotron/slider at the top, three little 'highlight' boxes below that, and then a few distinct sections running down the remainder of the page, probably with images floated to alternating sides. (Kind of like this.) All of these components are actual content, so they need to be easily editable by the user. When a new version of the product comes out, they need to be able to change the headline in the Jumbotron, to describe the new features in the little highlight boxes, to update the alternating images in the sections, &c. The methods i have considered include using either widgets or something like Advanced Custom Fields to create separate editable areas for the Jumbotron, &c., but these don't seem very robust or elegant. I have also looked into using shortcodes to create simplified wrappers around these page components, but WordPress has a thousand little bugs that screw with the contents of shortcode blocks (extraneous line breaks, stray opening and closing tags, &c.). I have seen WordPress sites that use page structures like i've described, but i haven't been able to find any free themes/plug-ins that show how they manage it. Are the methods i mentioned above what these sites generally use, or is there some basic WordPress feature that i'm not understanding here?


title: Show login greeting above sub-menu links?

text: I'm using WordPress' built-in menu system to output my Main Menu Structure. I have one sub-menu, and it has two links currently, "Tracking" and "To-Do List". I want the following login greeting to show above those two links:               <?php global $current_user; if ( is_user_logged_in() ) { echo 'Welcome, '.$current_user->first_name.''; } else { echo 'Welcome, visitor'; } ?>         •     <?php add_modal_login_button( $login_text = 'Login', $logout_text = 'Logout', $logout_url = '', $show_admin = false ); ?>      The output looks like this if no one is logged in: `Welcome, visitor • Login` How can I show this output above the two sub-menu links?


title: Why images are disappearing on WordPress web site?

text: I had this problem on 2 web sites (different versions of WP, different web hosts, different plugins), once in a while some images are disappearing from media library. Is it plugin-related issue, database, web host?


title: Use the same date-based permalink structure for all post types

text: Is there a way to use exactly the same date-based permalink structure for all (non-hierachical) post types on a site, including posts and custom post types? I'd like all post types to have the format `/%year%/%monthnum%/%day%/%postname%/`, so the post type does not appear in the URL. With the default custom post type permalink structure, the following code successfully strips out the post type from the permalink (at the risk of causing problems with clashing post names, but I can live with that), but I can't figure out what I need to do to set the permalink to use the date structure.               class simons_permalinks {              function __construct() {                  add_action( 'pre_get_posts',  array( $this, 'pre_remove_slug' ) );             add_filter( 'post_type_link', array( $this, 'remove_slug' ), 10, 3 );              }              function pre_remove_slug( $query ) {                  if ( ! $query->is_main_query() )                 return;                  if ( 2 != count( $query->query ) or !isset( $query->query[ 'page' ] ) )                 return;                  $types = array( 'page', 'post', 'feature', 'opinion' );                  if ( ! empty( $query->query[ 'name' ] ) ) {                 $query->set( 'post_type', $types );             }              }              function remove_slug( $link, $post, $name ) {                  $types = array( 'post', 'feature', 'opinion' );                  if ( 'post' != $post->post_type and in_array( $post->post_type, $types ) and 'publish' == $post->post_status ) {                 $pto = get_post_type_object( $post->post_type );                 $link = str_replace( '/' . $pto->rewrite[ 'slug' ] . '/', '/', $link );             }              return $link;              }          } // class      Thanks, Simon


title: Change path of the page's template

text: It's possible to create templates for pages with that: `<?php /* Template Name: Contact */ ?>` This templates are located on the theme folder, right? Is possible to change the default path where WP search for those templates? If I want to make a lot of templates, can I create a folder to put them? Thanks


title: How to get media-button on front-end

text: I am using wp_insert_post to allow non-logged-in users to add post, and would like to have 'add-media' button as well on front-end. I tried wp_editor, but I don't want the text editor, just the add-media button, and that doesn't allow add-media for non-logged-in users. How can I achieve this?


title: Split a Multisite Into Single WordPress Websites

text: I am using wordpress export/import feature to slpit a multi site into single wordpress site. It is exported all the post but not extract the user. How can I export the user. Thanks, Alex


title: Tiny MCE custom styles, and preview in the backend

text: I've added the styles dropdown list to my TinyMCE editor in Wordpress. If I select the style, and preview it on the front end, it looks exactly like I expect it to. However, I'd like to preview it in the editor as well. By adding my '.blue-button' class to /wp- includes/js/tinymce/themes/advanced/skins/wp_theme/content.css, I was able to preview it like I want to, but this seems hackish and will probably break upon a TinyMCE update. Is there a filter to do this? So far I have the following:               add_filter('tiny_mce_before_init', 'customizeWYSIWYGToolbar' );     function customizeWYSIWYGToolbar($init) {         $init['theme_advanced_buttons2_add_before'] = 'styleselect'; // Adds the buttons at the begining. (theme_advanced_buttons2_add adds them at the end)         $init['theme_advanced_styles'] = 'Blue Button=blue-button';         $init['theme_advanced_disable'] = 'underline, justifyfull, charmap, pasteword';         return $init;     }          add_filter( 'mce_css', 'tdav_css' );     add_editor_style('css/admin.css');          add_action('init', 'WYSIWYGCSS');     function WYSIWYGCSS(){         wp_enqueue_style( 'wysiwygStyles', get_bloginfo('stylesheet_directory').'/css/admin.css', ",",'all' );      }      Thanks!


title: Changing document title only on a custom page template

text: Hi can anyone help with the below, please? I want to be able to change the contents of my HTML `<title>` tag only, so need to write an if / else statement. I'm getting myself a bit muddled as my PHP isn't great... but basically something along the lines of the below but combined...               <?php if ( ! is_page_template('boatDetails.php') ) { ?>     <title><?php bloginfo('name'); ?><?php wp_title('|'); ?></title>     <?php } ?>     <?php if ( is_page_template('boatDetails.php') ) { ?>     <title>I'm the boat details page</title>     <?php } ?>      Thanks :)


title: Verify Submitted Form Values and Show Warning Messages with Setting API

text:
I'm making a plugin administration page with the settings API. I'd like to know a way to display a warning message when the user submits an invalid value. For example, with the below code, if the user sends an empty value for Option A, the first input field, I'd like to show a message that says it's invalid and please fill the form. And the other submitted option values should not be saved to the database but remain in the input fields with the message on the page.               <?php     /*     Plugin Name: Demo Verification Notice with Settings API     Description: Learning how to warn invalid values when submitting the form and take back the user to the setting page without saving the options.     Author: Teno     */          add_action('admin_init', 'settingsapi_init');     function settingsapi_init(){         register_setting( 'settingsapi_optiongroupname', 'settingsapi_optionname');         add_settings_section('plugin_main', 'Section 1', 'settingsapi_sectiondescription', 'settingsapi_pageslug');         add_settings_field('plugin_text_string_a', 'Option A', 'settingsapi_setting_string_a', 'settingsapi_pageslug', 'plugin_main');         add_settings_field('plugin_text_string_b', 'Option B', 'settingsapi_setting_string_b', 'settingsapi_pageslug', 'plugin_main');     }          function settingsapi_sectiondescription() {         echo '
This is a section description.
';     }     function settingsapi_setting_string_a() {         $options = get_option('settingsapi_optionname');         echo "<input id='plugin_text_string' name='settingsapi_optionname[option_a]' size='40' type='text' value='{$options['option_a']}' />";      }      function settingsapi_setting_string_b() {         $options = get_option('settingsapi_optionname');         echo "<input id='plugin_text_string' name='settingsapi_optionname[option_b]' size='40' type='text' value='{$options['option_b']}' />";      }     // admin menu     add_action('admin_menu', 'plugin_admin_add_page');     function plugin_admin_add_page() {         add_options_page('Custom Plugin Page', 'Demo Settings API Menu for Verification', 'manage_options', 'settingsapi_pageslug', 'settingsapi_adminpage');     }          function settingsapi_adminpage() {         ?>
             <?php screen_icon(); ?>
Demo Plugin for Settings API
             <form action="options.php" method="post">                 <?php settings_fields('settingsapi_optiongroupname'); ?>                 <?php do_settings_sections('settingsapi_pageslug'); ?>                 <?php submit_button(); ?>             </form>
         <?php     }     ?>      Is that possible with the settings API? The register_setting() function accepts the third parameter as validation function call. However, it can be used to just fix the passed value but it accepts the form submission and saves the options. That is not what I'm looking for. [Edit] Okey, I'm almost there. This validates the submitted value with the callback function set in the register_setting() function. And if the value is invalid it leaves a flag, invalid, in the option array and displays a warning message. However, there is one remaining issue. Otherwise, it is almost done.   1. Once an empty value is set to the first input option, it shows the warning message. It is what we've achieved so far. And if the user leaves the page showing the warning, somehow the empty value is saved to the option. It should revert the previous value.  The code below is ready to use as a plugin. If you run it, you'll see what I'm talking about.               <?php     /*     Plugin Name: Demo Verification Notice with Settings API     Description: Learning how to warn invalid values when submitting the form and take back the user to the setting page without saving the options.     Author: Teno     */          add_action('admin_init', 'settingsapi_init');     function settingsapi_init(){         register_setting( 'settingsapi_optiongroupname', 'settingsapi_optionname','validation_callback');              add_settings_section('plugin_main', 'Section 1', 'settingsapi_sectiondescription', 'settingsapi_pageslug');         add_settings_field('plugin_text_string_a', 'Option A', 'settingsapi_setting_string_a', 'settingsapi_pageslug', 'plugin_main');         add_settings_field('plugin_text_string_b', 'Option B', 'settingsapi_setting_string_b', 'settingsapi_pageslug', 'plugin_main');     }          function settingsapi_sectiondescription() {         echo '
This is a section description.
';     }     function settingsapi_setting_string_a() {         $options = get_option('settingsapi_optionname');         ?>         <input type="hidden" name="settingsapi_optionname[submitted]" value="1" />     <? print_r($options); ?>
         <input id="plugin_text_string" name="settingsapi_optionname[preview][option_a]" size="40" type="text" value="<?php echo $options['submitted']  ? $options['preview']['option_a'] : $options['valid']['option_a']; ?>" />         <?php echo ($options['invalid'] && $options['submitted'] ) ? '* cannot be blank.' :'' ?>         <?php     }      function settingsapi_setting_string_b() {         $options = get_option('settingsapi_optionname');         ?>     <? print_r($options); ?>
           <input id="plugin_text_string" name="settingsapi_optionname[preview][option_b]" size="40" type="text" value="<?php echo $options['submitted'] ? $options['preview']['option_b'] : $options['valid']['option_b']; ?>" />         <?php     }     // admin menu     add_action('admin_menu', 'plugin_admin_add_page');     function plugin_admin_add_page() {         add_options_page('Custom Plugin Page', 'Demo Settings API Menu for Verification', 'manage_options', 'settingsapi_pageslug', 'settingsapi_adminpage');     }          function settingsapi_adminpage() {         ?>
             <?php screen_icon(); ?>
Demo Plugin for Validation Message with Settings API
                  <?php             $options = get_option('settingsapi_optionname');             print_r($options);      // for debugging purpose             if (!($options['invalid'] && $options['submitted'])) {                      // update the correct option values                 $options['valid'] = is_array($options['valid']) ? $options['valid'] : array();  // if the options['valid'] is called for the first time, make it an array                 $options['valid'] = array_merge($options['valid'], $options['preview']);                 // $options['preview'] = '';    // initialize the preview option data. //<-- this seems to cause a problem                 update_option('settingsapi_optionname', $options);             }             ?>                  <form action="options.php" method="post">                 <?php                  settings_fields('settingsapi_optiongroupname');                 do_settings_sections('settingsapi_pageslug');                       // after displaying the form content, set the invalid flag and the subbmited flag to false                 $options['invalid'] = False;                 $options['submitted'] = False;                       update_option('settingsapi_optionname', $options);                        submit_button();                 ?>                       </form>
             <?php                  print_r($options);             ?>           <?php     }          function validation_callback($input){         if (strlen(trim($input['preview']['option_a'])) == 0 && $input['submitted']) {             // $input['preview']['option_a'] = '';             unset($input['preview']['option_a']);             $input['invalid'] = True;   // <-- this one is the problem. It seems to be called multiple times and setting the invalid flag to true when it's not necessary.             add_settings_error('unique_identifyer',esc_attr('settings_updated'),__('Settings NOT saved.'),'error');             add_action('admin_notices', 'print_errors');         } else {             $input['invalid'] = False;         }         return $input;     }          function print_errors(){         settings_errors( 'unique_identifyer' );     }          ?>      [Edit] It might be easier to do it without the Settings API. Here is a working example.               <?php     /*     Plugin Name: Demo Verification Warning without Settings API     Description: Demo plugin demonstrating how to display a warning message when the user tries to save an invalid value in the option page.     Author: Teno     */          // define constants     define("DEMOVERIFICATIONKEY", "demo_verification_option");          // create an option array     $arrOption = get_option(DEMOVERIFICATIONKEY);     if (!(is_array($arrOption))) {         $arrOption = array(             "tab1" => array(),             "tab2" => array(),             "tab3" => array()         );         update_option(DEMOVERIFICATIONKEY, $arrOption);     }          // admin menu     add_action('admin_menu', 'demo_verification_adminmenu');     function demo_verification_adminmenu() {         add_options_page('Demo Plugin Menu for Verification without Settings API', 'Demo Plugin Menu for Verification without Settings API', 'manage_options', 'demo_verification_admin_menu', 'demo_verification_adminpage');     }     // admin page     function demo_verification_adminpage() {         $options = get_option(DEMOVERIFICATIONKEY);         print_r($_POST); // for debugging         echo '
';         if(isset($_POST[DEMOVERIFICATIONKEY]['tab1']['submitted']) && $_POST[DEMOVERIFICATIONKEY]['tab1']['submitted'] == 1){             if (strlen(trim($_POST[DEMOVERIFICATIONKEY]['tab1']['option_a'])) == 0) {                 $options['tab1']['invalid'] = True;                      echo '

Options are not saved.

';             } else {                     $options = array_merge($options, $_POST[DEMOVERIFICATIONKEY]);                 update_option(DEMOVERIFICATIONKEY, $options);                 echo '

Updates are saved.

';             }         }            ?>
             <?php screen_icon(); ?>
Demo Plugin for Validation Message without Settings API
             <form method="post" action="">  <?php // 'action=""' means to send the form post data to this page itself. ?>                 <input type="hidden" name="<?php echo DEMOVERIFICATIONKEY; ?>[tab1][submitted]" value="1" />

                         Option A	                                                      <input name="<?php echo DEMOVERIFICATIONKEY; ?>[tab1][option_a]" size="40" type="text" value="<?php echo $options['tab1']['invalid']  ? $_POST[DEMOVERIFICATIONKEY]['tab1']['option_a'] : $options['tab1']['option_a']; ?>" />                             <?php echo ($options['tab1']['invalid'] && $options['tab1']['invalid'] ) ? '* cannot be blank.' :'' ?>

                         Option B	                                                      <input name="<?php echo DEMOVERIFICATIONKEY; ?>[tab1][option_b]" size="40" type="text" value="<?php echo $options['tab1']['invalid'] ? $_POST[DEMOVERIFICATIONKEY]['tab1']['option_b'] : $options['tab1']['option_b']; ?>" />

                 <?php submit_button(); ?>                </form>
         <?php     }     ?>      But in case if somebody can figure it out with the Settings API, please post the solution.


title: How do you remove plugin edit option?

text: I would like to remove the edit option for all plugins on a wordpress site. Is there a hook/filter for doing this? It would be preferred to do it from the theme's functions file, rather than try to disable it within each plugin. Ideally, it could be removed for users without admin privileges, but that is a secondary concern. ![enter image description here](http://i.stack.imgur.com/Z43H5.jpg)


title: Action hook on Edit custom post type?

text: Is there an explicit action hook that will fire when (or just before) the admin Edit page renders for a custom post type? Something similar to {$new_status}_{$post->post_type}? I'm trying to find the least obtrusive place to insert my add_meta_box() registration so that it's not calling that function on every page refresh, but only when it's needed (ie: the user wants to create a new custom post or edit an existing custom post). Thanks for your thoughts / code snippets!


title: BuddyPress: What's the use of wp_bp_xprofile_data table and how does it get updated?

text: I have a questions related to BuddyPress:   What's the use of `wp_bp_xprofile_data` table? How does the data in the table get updated?   And when any user updates his information - does the data in this table get updated?


title: get_terms function not returning anything

text: This has had me baffled for days so any help would be appreciated. I cannot get the function `get_terms` to return anything. I've tried the following code in the **index.php** , **single.php** and **page.php** , inside and outside the loop, of the default Twenty Thirty theme as well as my custom theme and no category terms are returned. I've created 10 test category terms and applied them to different test posts and still nothing. It's not working on the live site or the local development site. I've also tried flushing the rewrite rules by going to the Permalink Settings page and re-saving, just to see if that helped. Researching and finding any similar problem online has the same answer: add the `hide empty` part. So I did, to no avail. Any ideas why this function would not be working? `<?php get_terms("category") ?>` `<?php get_terms("category", array("hide_empty" => 0)) ?>`


title: How to link keywords in custom fields?

text: I have come across different WordPress plugins that will automatically link/hyperlink keywords--to external links--every time they appear throughout posts. Here's an explanation of what I mean: **Site page 1 content:** Georgio went to the store after he stopped by to see how Nichols was doing. **Site page 2 content:** The cat was afraid of Georgio and his dog. **Site page 3 content:** My best friend is not a friend of Nichols, who is the best friend of Georgio, but is a friend of Georgio. **What I need done:** On each page (1, 2, 3) and each time it appears on each page, I want "Georgio" to be linked to the same external website (like http://geethr33whiskers.net <---I just made that up), but without me having to manually link each "Georgio". I want to be able to link "Georgio" once and then automatically the other instances will be linked to the same external website. On each page (1, 3) and each time it appears on each page, I want "Nichols" to be linked to the same external website (like http://www.nichols2zzz4wedding.com <---I just made that up), but without me having to manually link each "Nichols". I want to be able to link "Nichols" once and then automatically the other instances will be linked to the same external website. **END OF EXPLANATION** Now back to what I was saying before the explanation... All the plugins that I've found are only linking the specific keywords found within the post_content area of the posts. My content is not found within the default WP post_content area, though. I am using the 'custom fields' feature of WP to enter the content for every one of my posts (I do this so I can have better control of where the content appears on the site). How do I get the plugins to look within the 'custom fields' for the keyword to link? Is there a 'custom fields' code I need to add to the plugin files? Thanks.


title: Common side bar for multiple websites

text: I have 5 WordPress sites and each site should have the same sidebar content. It is dynamically posted from userend and it should be common to all my WordPress sites. Without using iframe, how can I repost the same content that is in the right sidebar?


title: Table truncated on Mobile theme

text: I have a problem with tables into posts, I not able to see all the data in the tables on wptouch mobile theme, because they are truncated on the right on mobile screen. Plugin used: WPTouch, CKeditor for tables. But I have the same problem with any tables editor. can you help me ? It's very hard to have support from Wptouch, and I found this very good website ;). * * * Here their answer to my problem: Tables often use fixed dimensions. By definition, fixed dimensions override any scaling capabilities of iOS or WPtouch. Choose to use flexible dimensions whenever possible to allow page elements to resize for various mobile screen sizes. If you are unable to change these dimensions at their source, you may add custom styling in the Stats & Custom Code area of your WPtouch admin panel. (In your case, the table widths appear to be set inline). The tool tip there will give you additional information if you want to use a stylesheet otherwise simply include your custom CSS inside style tags. * * * Could you advice a sample code to add into Stats & Custom Code area of WPtouch panel to to use flexible dimensions ? I have no idea how change the flexible dimensions at the source and what code I can use in WPtouch. Thank you very much, looking forward to your reply. Website page sample with tables: http://gt-scuderia.net/2013/03/27/coppa- gtscuderia-seca-il-02042013/ here one screenshot of my problem: ![Table](http://i.stack.imgur.com/UCgAL.png) Angel.


title: edit_form_after_editor only in post edit pages

text:
I want to show some information in post edit screen. I found 2 hooks which allow to do this after title or after editor. Heres code with second one:               add_action( 'edit_form_after_editor', 'myprefix_edit_form_after_editor' );     function myprefix_edit_form_after_editor() {         global $post;         $author_id=$post->post_author;         $email = get_the_author_meta( 'user_email', $author_id);         $imie = get_the_author_meta( 'first_name', $author_id);         $nazwisko = get_the_author_meta( 'last_name', $author_id);         $nip = get_the_author_meta( 'nip', $author_id);         $login = get_the_author_meta( 'user_login', $author_id);         $firma = get_the_author_meta( 'nazwa_firmy', $author_id);         echo '
DANE FIRMY
';         echo 'Nazwa firmy: ', $firma;         echo '
Imię: ', $imie;         echo '
Nazwisko: ', $nazwisko;         echo '
NIP: ', $nip;         echo '
E-mail: ', $email;         echo '
Login: ', $login,'

';     }      I want this information to show only on post edit pages - now it shows everywhere (custom post type edit pages, pages edit screens etc.). Maybe theres hook which allows to show this info under featured image (right part of edit screen).


title: Restrict categories to a custom post type

text: In the WP-Admin when creating a post or a custom post type I want to restrict certain categories to a custom post type. For example, Posts will only be able to select Category A and B. And custom post type A will only be able to select Category C and D. Would I have to write some code to hook into somewhere or is there a function built-in to the framework? Thanks in advance.


title: how to properly list child pages in sidebar?

text:
My pages menu is maximum 3 levels deep and I am having a hard time figuring out how to properly list the child pages in the sidebar. If a page is a parent I want to list it's direct child pages and the title should be this parent. If a page is a child AND has children of itself, I want to list only it's children and the title should be this page If a page is a grandchild, I want to list it's siblings and the title should be this grandchild. For now I am using (from the Codex):               <?php if($post->post_parent) {     $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0&depth=1&sortcolumn=menuorder");     } else {     $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0&depth=1&sortcolumn=menuorder");     }     ?>     <?php if ($children) { ?>

<?php _e('More ','sunchine') ?><?php echo get_the_title($post->post_parent);?>

     <?php echo $children;?>

     <?php     }     ?>      And this is almost correct. Almost, because my it doesn't do my 2nd criterium. The Codex has heaps of options, but I cannot figure out which would be applicable to what I want to accomplish. Using widgets and/or a plugin is not an option. Any help is much appreciated.


title: How to set ipv6 address as siteurl?

text: I have try to set ipv6 ip address as home and site url, but it seems not work perfectly. From there: `http://[2001:da8:d800:71::250]/wordpress/` (if you view the source) we see that some url, such as `pingback` (line 16) where correct, but others, such as `rss` (line 20) were lost `[` and `]`, how to fix this? (if I don't have an domain which point to this ipv6 address.)


title: In the fv wordpress flowplayer plugin , i cannot stop the autoplay option

text: I am using fv wordpress flowplayer plugin , i cannot stop the autoplay option. i have used the coding.               <?php       $videourl =" [flowplayer src='https://s3-eu-west-1.amazonaws.com/brightstartvideos/Tester+2.mp4' splash=image.jpg autoplay=false]  " ;     echo $videourl; ?>      I put autoplay=false but it is still autoplaying the video. Please advise me..........


title: change captcha design in Fast Secure Contact Form plugin

text: I am using  Fast Secure Contact Form plugin to create contact form widget.It working fine . Now i like to change captcha appearance. Original captcha generated by plugin ![fs contact form generates captcha](http://i.stack.imgur.com/g9atG.png) But, I need to change it design like below ![enter image description here](http://i.stack.imgur.com/4zTTt.png) Any option available or any other ways to do this ! Thanks in advance


title: Transients and WP Super Cache?

text: Is it worth using Transients when running WP Super Cache? We have a website that get's updated 20 times a day with new post, so I set a lot transients for queries that don't reflect those updates. My reasoning is that every time we post, it clears WP Super Cache cache. Is this overkill?


title: I have a question in Basic HTML

text: What does it mean to edit a website directly? My professor tells us not to use an editor. I'm not sure how to do so either.


title: Using My Own Classes On Wp Unit Tests

text: (I'm trying to solve style problems of code samples) I'm developing a theme but I have some classes which developed for this theme. I want to run unit tests on my theme. I've followed this steps:   1. Checked out test repo to my root web folder:              svn co http://develop.svn.wordpress.org/trunk/ wordpress-develop        2. Copied my theme folder to _wordpress-develop/src/wp-content/themes_   3. Created an empty database and set up _wp-tests-config.php_ file. Also added this line to _wp-tests-config.php_              define( 'WP_DEFAULT_THEME', 'THEMENAME' );        4. Created _wordpress-develop/tests/phpunit/tests/konser.php_ file with this content:              <?php     class Test_Konser extends WP_UnitTestCase {          public function test_firstTest(){          // Arrange             $id = $this->factory->post->create(array(                     'post_type' => 'konser',                 ));             add_post_meta($id, "konser_tarih", time());          $ids = get_posts(array(                 'post_type' => 'konser',                 )             );          foreach ($ids as $id) {          $this->assertInstanceOf('WP_Post',$id);         $ss = get_post_meta($id->ID, "konser_tarih", true);         $this->assertTrue($ss!='');         }     }     }      ![enter image description here](http://i.stack.imgur.com/cxE58.png)   5. But I want to use my `Konser` and `PostType` classes.              function setUp() {             $this->post_id = new Konser(410);        parent::setUp();     }     function test_ID() {         $this->assertInternalType("int", $this->post_id);     }        6. Added this 2 lines to _/wordpress-develop/tests/phpunit/includes/functions.php_                require_once('src/wp-content/themes/THEMENAME/include/PostType.php');       require_once('src/wp-content/themes/THEMENAME/include/Konser.php');        7. But I'm getting **Call to undefined function get_post() in konsertv-develop/src/wp-content/themes/THEMENAME/include/PostType.php** Can you tell me what I'm missing? CONTENT OF PostType.php                 <?php       class PostType       {     public $post;     public $ID;          function PostType($ID) {         $this->post = get_post($ID);         $this->ID = $ID;     }     function getPost()     {         return $this->post;     }     function getTarih()     {         return get_post_meta($this->ID, "konser_tarih", true);     }     function getID()     {         return $this->ID;     }      }


title: How can i make a search box to search by custom field

text: Hy i am trying to make a search box for a week to search for post that have a specific custom field. I have a post_type - **produse** with 2 custom field   * > CF1- culoare / alb,maro,verde    * > CF2- marime / 120x200, 200x300 Ok i want to make a checkbox form and select, after i select wath i want and push search i want to retrive the post that i have atached the custom field. This i have made this from search around web.. but this is not working.. it load the cpu on my web hosting..               <?php      $field = get_field_object('culoare');     $values = explode (',', $_GET['culoare']);     ?>          <form>         <fieldset>             <legend>Cauta dupa culoare:</legend>             <?php if (!empty($field['choices'])) : $i = 0; foreach( $field['choices'] as $choice_value => $choice_label ): ?>             <?php $culoareIndex = strtolower($choice_value); $i ++; ?>             <input type="checkbox" name="culoare" value="<?=$choice_value?>" id="checkbox-1-<?=$i?>" class="regular-checkbox-<?=$culoareIndex?>"             <?php if( in_array($choice_value, $values) ): ?> checked="checked" <?php endif; ?> />             <label for="checkbox-1-<?=$i?>"></label>              <?php endforeach; endif; ?>             <input type="submit" value="Search" />         </fieldset>     </form>      Functions.php               add_action('pre_get_posts', 'my_pre_get_posts');          function my_pre_get_posts( $query ) {         if( is_admin() ) { return; }         $meta_query = $query->get('meta_query'); // get original meta query              // validate type         if( (empty($_GET['culoare'])) )         {             return;         }              // get types as an array         // - use explode to get an array of values from type=a|b|c         $culori = explode('|', $_GET['culoare']);              // set compare for the meta_query         // - http://codex.wordpress.org/Class_Reference/WP_Query         $meta_query['relation'] = 'OR';                   foreach( $culori as $culoare )         {             $meta_query[] = array(                 'key'       => 'culoare',                 'value'     => '"' . $culoare . '"',                 'compare'   => 'LIKE',             );         }                   $query->set('meta_query', $meta_query); // update the meta query args              return; // always return     }      Can somebody show me how is done,please, and point me in the right direction, i'm not so good with php and i want this to be made. Thanks


title: Limit to One Custom Taxonomy Selection, Including Most Used

text:
I've got a bit of code that limits my custom taxonomy to only allow the user to select one category, by turning the checkboxes in to radio buttons. See the screenshot below for example: ![](http://i.imgur.com/XDYyViK.jpg) I need the Most Used section to also display as radio buttons, but the code I have only affects the All Categories field. See the below screenshot: ![](http://i.imgur.com/X0Y2FwO.jpg) So, how can I extend this code to also cover the Most Used section?               // limit number of categories a product can have     add_filter('wp_terms_checklist_args', 'htmlandcms_select_one_category');     function htmlandcms_select_one_category($args) {         if (isset($args["taxonomy"]) && $args["taxonomy"] == "product-category") {             $args["walker"] = new Walker_Category_Radios;             $args["checked_ontop"] = false;         }         return $args;     }     class Walker_Category_Radios extends Walker {         var $tree_type = "category";         var $db_fields = array ("parent" => "parent", "id" => "term_id");         function start_lvl(&$output, $depth = 0, $args = array()) {             $indent = str_repeat("\t", $depth);             $output .= "$indent
\n";         }         function end_lvl(&$output, $depth = 0, $args = array()) {             $indent = str_repeat("\t", $depth);             $output .= "$indent
\n";         }         function start_el(&$output, $category, $depth, $args, $id = 0) {             extract($args);             if (empty($taxonomy)) {                 $taxonomy = "category";             }             if ($taxonomy == "category") {                 $name = "post_category";             } else {                 $name = "tax_input[" . $taxonomy . "]";             }             $class = in_array($category->term_id, $popular_cats) ? " class=\"popular-category\"" : "";             $output .= "\n
term_id}\"$class>" . "<input value=\"" . $category->term_id . "\" type=\"radio\" name=\"" . $name . "[]\" id=\"in-" . $taxonomy . "-" . $category->term_id . "\"" . checked(in_array($category->term_id, $selected_cats), TRUE, FALSE) . disabled(empty($args["disabled"]), FALSE, FALSE) . " /> " . esc_html( apply_filters("the_category", $category->name)) . "";         }         function end_el(&$output, $category, $depth = 0, $args = array()) {             $output .= "
\n";         }     }      Original code taken from this answer. **UPDATE** ~~I'm thinking this has something to do with`$tree_type`, but I can't seem to find any documentation about valid values for this.~~ Commenting that out does absolutely nothing, so I don't think that's relevant at all. I'm thinking the walker's just not getting run on Most Used.


title: How to display post tags

text:
I'm converting an HTML template into a wordpress theme and I'm having some trouble displaying the post tags within the functions.php file. What I would like to do is add the following code into the functions file with the HTML code. I have been trying for a few days now and I have already been to the codex but nothing I try is working.
     tag 1 tag 2 tag 3 tag 4
      Can anyone please help with this?


title: jQuery.accordion isn't a function even when enqueued

text: I'm trying to implement a jQuery accordion for a client of ours. Basically, it's this tutorial (http://wp.tutsplus.com/tutorials/creative-coding/create- an-faq-accordion-for-wordpress-with-jquery-ui/) but having problems enqueuing the jQuery. Basically, this is the code that is trying to enqueue the accordion script from the tutorial:-               add_action( 'wp_enqueue_scripts', 'fl_enqueue' );          function fl_enqueue() {             wp_register_style('fl-jquery-ui-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/south-street/jquery-ui.css');             wp_enqueue_style('fl-jquery-ui-style');             wp_register_script('fl-custom-js', get_template_directory_uri() . '/faq/faq.js', 'jquery-ui-accordion', '', true);             wp_enqueue_script('fl-custom-js');     }      When loading the page with Firebug, I'm getting the error TypeError: jQuery(...).accordion is not a function. I also cannot seem to see the accordion script being enqueued. However, the faq.js IS being loaded (which I think is odd, as it's a dependancy of the accordion script). Baffled by this, any ideas?


title: Add comments from the admin panel?

text: I'm using WordPress as an Authoring tool. Hence I do not use the front end. Now I wanna add the functionality making internal comments. As it is now, you are only allowed to read comments from the Edit Post page, not to write them. Got any hints or good ideas on how to make this possible?


title: What is wrong with this code to remove wp admin bar from one page

text: I'm just trying to turn off the wp admin bar on one page, but this function removes it from every page. What am I missing?               <?php        if ( !is_page('image-upload') ):         show_admin_bar(false);       endif;     ?>


title: Comments not displaying after changing theme

text: The 'Leave a Reply' section at the end of my posts are not displaying after changing to the 'The Morning After' theme. Comments and reply sections are displaying when I revert to the Twenty Eleven theme. I have tried re- installing the theme but it is still not working. Example post at: http://richashworth.com/testing/


title: Give each post type label a different color?

text: On my homepage I am using a code to call different post type labels. Example: > TV Series: "Once Upon A Time" Here is the code I use to call the label:               <a href="<?php echo get_post_type( $post->ID ); ?>">         <?php $post_type = get_post_type_object( get_post_type( $post ) );         echo $post_type->label; ?>     </a>      I want to place each post type in a div with different background colors. Example: ![Example](http://i.stack.imgur.com/yjwk4.jpg) Do you see how once upon a time has a different background from pretty little liars? I also want to be able to make the link color different.


title: WP 3.5 - How to remove permalink from images

text: In previous versions of WP, we were able to remove permalink from images while we were inserting images into post. But, now there is no obvious option to do so. How can it be achieved? Thanks.


title: how to create add-able metaboxes in wordpress post edit screen?

text: Is there anyone who knows how to create add-able multiple metaboxes, easy enough for a user to add a meta box on demand in a single post edit screen ?


title: get_the_post_thumbnail($post->ID, 'thumbnail'); not working. How can I solve this?

text:
I am using the following code to display the posts on my home page. But I could not print **thumbnails** using `get_the_post_thumbnail($post->ID, 'thumbnail');` any help to solve this will be very much appreciated..               while (have_posts()) : the_post();                     $excerpt = get_the_excerpt();                        $date = explode(",", get_the_time("F,j,Y", "", "", false));                     print('

');                                      print('
                                                                              ' . $date[1] . '
' . substr($date[0], 0, 3) . '
');                         print ('
');                                 the_title('
', '
');                         print ('
');                                                            print ('
');                         print ('

');                             if (strlen(get_the_content()) > 100) {                                 $content = get_the_content();                                 echo str_replace(' ', '

', substr($content, 0, 300)). "....";                                    echo '
Read More';                                 echo get_the_post_thumbnail($post->ID, 'thumbnail'); // post image thumbanails                             }                             else { the_content(); echo "
"; }      ** if I use the `feature image` then it prints twice. Thanks.


title: External Authentication

text: I currently have a website with its own user authentication. It also has 3 separate installations of WordPress in its subdirectories, each loading data from 3 separate databases. What I would like to do is load wp- includes/pluggable.php when authenticating users on the main site in order to carry out WordPress authentication at the same time, as outlined in the following answer: http://wordpress.stackexchange.com/a/11472 However, as I have 3 WordPress installations that I would have to authenticate users for and generate cookies, this would be extremely difficult. Does anyone have any pointers/ideas on how I would do this? Thanks


title: Password Protected Post is invisible until you login

text: I added a post and made it password protected. The post does not show up in a category list I placed on the Courses page, nor does it show up in the search unless you go directly to the page and then login. It then starts appearing on the Courses page. Any idea how to have the link to the post visible? The page they should show up are on: http://www.andrewruis.com/course/. If you search for "asb 129" nothing shows up in the search.


title: how to include javascript file and css file in wordpress

text: I am creating new plugin so i need add a java script file and css file. These are my javascript files   1. jquery.min.js   2. jquery-1.3.2.min.js   3. jquery.tabify.js Css file:   1. newstyle.css


title: getting a js file for one page

text: wp_register_script('SliderViewer', '/js/SliderViewer-1.2.js');     wp_enqueue_script('SliderViewer');          get_header();      however, `mydomain.com/js/SliderViewer-1.2.js` doesn't exist. My js is in the ftp at               thewebsite -> wp-content -> themes -> BLANK-Theme -> js      What's the path of that? Thanks-


title: Are Categories, Tags and Custom Taxonomies any different in regards to SEO?

text: Simple question, really. I know pretty much nothing about SEO, and i'm trying to define a good structure for this clients online magazine. I already know i'll be using a few custom taxonomies along with categories and tags, but the question is: if not using any SEO plugin, are either Categories, Tags and Custom Taxonomies any more "searchable" or "optimized" than their counterparts? eg.: Is the category Adamantium any more "relevant" than the adamantium tag or the adamantium custom term just because it's a category (or b/c it's hierarchical)? Does this even make any sense?


title: Embed tag length issues

text: I have a pdf in my media library that I am trying to embed on a page. The width works fine but the length does not. I am trying to basically represent 8.5 x 11 on the screen. As it is only about 3-4 inches in screen length are shown and the rest is scroll bar.               <embed src='http://example.com/wp-content/uploads/.../somefile.pdf' width='1000px' length='1200px' />      I have even tried using length='100%'.


title: Conditionally write open graph meta property in header

text: Have a function I use to print Open Graph tags in the header of each page I also have a plugin I use to post to Facebook which also puts in it's own set of basic OG Tags. Facebook doesn't like if a page as more than one og:url tag. The plugin only works on single pages so I want to not print my og:url tag when it is on a single post page. I want to test for is_home and is_tag and if those are true the function will print the og:url tag. The other problem is the home page has a completely different url than the tag page. I tried doing the conditional inside the meta tag but Facebook vomits if the og:url line even exists. Here is the code I currently have and everything except the conditional for the og:url tag is working:                   function wpc_fb_opengraph() {     $wpc_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(),     'large');     ?>     <?php echo "\n<!-- Start of OG Tags from DougTheme 2013 -->\n"; ?>     <meta property="og:image" content="<?php if (function_exists('catch_that_image')) {echo catch_that_image(); }?>" />     <meta property="fb:admins" content="XXXXX"/>     <meta property="fb:app_id" content="XXXXXXXXXX">     <meta property="og:site_name" content="<?php bloginfo('name'); ?>" />     <meta property="og:description" content="<?php if ( is_singular() ) { echo strip_tags(get_the_excerpt()); } else { echo "comments about everything"; } ?>" />     <meta property="og:title" content="<?php if ( is_singular()) { echo esc_attr( get_the_title() ); } elseif (function_exists('is_tag') && is_tag()) {single_tag_title('Tag Archive for "'); echo '" - '; echo get_bloginfo('name');} else { echo get_bloginfo('name'); } ?>">     <meta property="og:type" content="<?php if ( is_singular() ) { echo "article"; } else { echo "website";} ?>">             if (is_home()) {             <meta property="og:url" content="<?php bloginfo('url'); ?>" />     <?php } //end if home          elseif ( is_tag() ) {         <meta property="og:url" content="<?php echo $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];  ?>">     <?php }                     <?php echo "\n<!-- End of OG Tags from DougTheme 2013 -->\n"; ?>     <?php }          add_action('wp_head', 'wpc_fb_opengraph');      I get a syntax error in either of the lines testing for the page. I'm stumped.


title: How to get all posts (in chunks) via XML-RPC?

text: **I would like to retrieve all posts of a blog via the XML-RPC API of Wordpress.** There are the methods of `blogger.getRecentPosts` and `metaWeblog.getRecentPosts` which - given a sufficiently high value as number of posts (or -1) in theory should return all posts. However, this does not work for very large blogs or very weak servers that cannot hold the whole blog in memory. In that case, these functions will not return anything at best or throw an error into the response XML. A solution would be to retrieve smaller chunks of, e.g. 50, posts at a time and put it all together on the receiving side. For this to work one would need to specify an offset for the posts to get. I was not able to find a way to specify such an offset in the documented API. **Is there any way to make this work, either by specifying an offset or by using other than the methods mentioned above?** I'm not looking for a description on how to write a plugin or modify Wordpress itself in any way. I can do that, sure, but I'm talking about authorized retrieval of data of arbitrary Wordpress blogs. **Edit:** I've opened a trac ticket at Wordpress with a suggestion for solution: http://core.trac.wordpress.org/ticket/16316


title: IE Jquery Access Denied

text: Below code i am using it to open print window with some html content in some div. This code is working perfectly fine with Chrome and Firefox however when I run it on IE 8,9 it is opening a window with URL: [http : / / /] and getting crashed. what am i missing. document.domain is required for iframes. I am not able to find out what is the issue here.               jQuery(function ($) {         $('a.certificate-window').click(function () {                 var btn = $(this),                     icsCertificate = btn.find('.em-certificate').html(),                                 recipecert =  window.open('','PrintWindow','width=925,height=725'),                     html = '' + icsCertificate + '';                 recipecert.document.open();                 recipecert.document.write(html);                 recipecert.document.close();                 return false;             });     });      Thanks, B


title: How to conditionally add a wp_filter

text: I have a WP filter I created that I only want to run on certain menu items. I am attempting to use -               function add_nav_class($output) {     $output= preg_replace('/<a/', '<a class="lsbb"', $output, -1);     return $output;     }          function wp_nav_menu_conditionals() {        if(!wp_nav_menu('theme_location' => 'footer_menu')) {           add_filter('wp_nav_menu', 'add_nav_class');        }     }     add_action('wp', 'wp_nav_menu_conditionals');      I want to add_filter on all menus that are not listed as theme_location footer_menu. Is there a way to do this in WP? If the menu is using theme_location footer_menu I want it to NOT use add_filter. Can anyone tell me how to use add_nav_class conditionally?


title: Alter query on edit.php

text: What's the best way to alter the query being run on the Posts Edit screen (edit.php)? The current method I'm using is by passing an argument to the global $wp_query like so:               $wp_query->query( array ('category__in' => array(14,9,2) ) );      However, this doesn't really work as expected once the user pages back and forth, filters, or searches.


title: Limit action in comment according to IP

text: I've been trying to set something that might be really easy (but I never had to do this before) :               add_filter('pre_comment_user_ip', 'limit_commentator');     function limit_commentator( $comment ) {         $comment_field_value = get_comment_meta( $comment->comment_ID, 'some_custom_field', true );         //my code          }      I think this is the right hook but how can I limit the ability for commentators to post comment WITH this custom field? Actually I just want one value per IP. Got another question : Is it really worthy to limit per IP? I've been thinking about a limit on a daily basis. What do you think about this?


title: loop through custom post types with meta data

text:
I'm really curious as to how might be the quickest way to loop through a custom post type with meta data. I have some code that works but it's slow. I'm using wp_query and it works. I have also a bunch of conditionals that check whether meta data exists and if so, to do something which is usually display it and a few times display a small image. There are 47 custom post types but maybe I'm just doing too much on one page? I've thought about using ajax to load them (kind of like infinite scrolling) but I'm not sure of the best method. I was wondering that what is "cost" of looping though custom post types with over 30 different meta data fields? Is there a better way to scan through the tables or is there other methods that don't have the high overhead? Thanks! Here is my code and I'll check out those tools as well.                                       <?php $count = 0; ?>                     <?php $args = array(                          'post_type' => 'property',                          'posts_per_page' => 100,                          'orderby' => 'meta_value',                          'meta_key' => 'random_775',                          'order' => 'ASC'                         );                                   $loop = new WP_Query( $args );                         while ( $loop->have_posts() ) : $loop->the_post(); ?>                              <div class="<?php wpp_css('property_overview::row_view', "wpp_row_view wpp_property_view_result"); ?>">                           <div class="<?php wpp_css('property_overview::all_properties', "all-properties"); ?>">                                  <?php $countyCheck = $theCounty;                              $theCounty = get_post_meta( get_the_ID(), 'random_775', true );                                  if ($theCounty != $countyCheck ){                             echo '
' . $theCounty . ' County
';                             } ?>                              <a href="<?php the_permalink(); ?>">                         <div class="<?php wpp_css('property_overview::property_div', "property_div {$property['post_type']} clearfix"); ?>">                                               <ul class="<?php wpp_css('property_overview::data', "wpp_overview_data"); ?>">                                          <?php $sArea = get_post_meta( get_the_ID(), 'area', true );                                     $nArea = preg_replace('/[^0-9]/','',$sArea);                                     $nArea = $nArea / 43560; // convert square feet area into acres                                     $sArea = number_format($nArea,1,'.',',');                                     echo '
';                                         echo '
';                                             echo '

' . get_post_meta( get_the_ID(), 'total_acres', true ) . ' acres +/- for sale

';                                             echo '
';                                                 $first_bullet_point_check = get_post_meta( get_the_ID(), 'first_bullet_point', true );                                                 if (isset($first_bullet_point_check[0])) {                                                     $firstPost = $first_bullet_point_check;                                                     $firstPost = substr($firstPost, 0, 30);                                                      echo '

· ' . $firstPost . '...

';                                                 }                                                 $second_bullet_point_check = get_post_meta( get_the_ID(), 'second_bullet_point', true );                                                 if (isset($second_bullet_point_check[0])) {                                                     $secondPost = $second_bullet_point_check;                                                     $secondPost = substr($secondPost, 0, 30);                                                     echo '

· ' . $secondPost . '...

';                                                 }                                                 $third_bullet_point_check = get_post_meta( get_the_ID(), 'third_bullet_point', true );                                                 if (isset($third_bullet_point_check[0])) {                                                     $thirdPost = $third_bullet_point_check;                                                     $thirdPost = substr($thirdPost, 0, 30);                                                     echo '

· ' . $thirdPost . '...

';                                                 }                                                 $turn_key_check = get_post_meta( get_the_ID(), 'turn_key', true );                                                 if ( $turn_key_check == 'true' ) {                                                     echo '

';                                                 }                                             echo '
';                                         echo '
';                                         echo '
';                                             //display image                                             the_post_thumbnail();                                             $pending_check = get_post_meta( get_the_ID(), 'pending', true );                                             if ( $pending_check  == 'true' ) {                                                 echo '

';                                             }                                             $sold_check = get_post_meta( get_the_ID(), 'sold', true );                                             if ( $sold_check == 'true' ) {                                                 echo '

';                                             }                                         echo '
';                                     echo '
';                                     $sAddress = get_post_meta( get_the_ID(), 'address', true );                                                      $asAddress = explode(',',$sAddress);                                 if (is_array($asAddress)) { // remove country                                     array_pop($asAddress);                                 }                                 if (is_array($asAddress)) { // remove zip                                     $sStateCode = array_pop($asAddress);                                     $sStateCode = preg_replace('/[^A-Z]*/','',$sStateCode);                                 }                                 $sCounty = get_post_meta( get_the_ID(), 'random_775', true );                                 $sAddress = "$sCounty, $sStateCode";                                      echo '
';                                     echo '
' . get_post_meta( get_the_ID(), 'random_775', true ) . ' Co.
';                                      echo '
PRICE
';                                     echo '
' . get_post_meta( get_the_ID(), 'price', true ) . '
';                                     echo '
';                                         $tillable_check = get_post_meta( get_the_ID(), 'tillable', true );                                         if ( $tillable_check == 'true' ) {                                             echo '

';                                         }                                         $tillable_check = get_post_meta( get_the_ID(), 'reduced_price', true );                                         if ( $tillable_check == 'true' ) {                                             echo '

';                                         }                                     echo '
';                                 echo '
';                                 ?>                                          <?php                                      $children_check = get_post_meta( get_the_ID(), 'children', true );                                     if($show_children && $children_check): ?>

<?php echo $child_properties_title; ?>

                                             <?php foreach($children_check as $child): ?>
                                                 <a href="<?php echo $child['permalink']; ?>"><?php echo $child['post_title']; ?>	                                                 <?php echo $child['price']; ?>
                                             <?php endforeach; ?>

                                     <?php endif; ?>                                          <?php if(!empty($wpp_query['detail_button'])) : ?>
<a <?php echo $in_new_window; ?> class="button" href="<?php echo $property['permalink']; ?>"><?php echo $wpp_query['detail_button'] ?>
                                     <?php endif; ?>


title: How can I prove if wp cron is running my task if I have DISABLE_WP_CRON set to true

text: I am trying to trigger a wp cron task via a real (linux) server cron and have followed online instructions to add this to wp-config:               define('DISABLE_WP_CRON', true);      My cron job does this :               wget -O - http://www.mysite.co.uk/wp-cron.php?doing_wp_cron=1      I have proved that the server's cron job is working (i receive the cron emails from the server when I remove > /dev/null 2>&1) but am unsure if my actual scheduled task is running. How can I prove this?


title: Copyright messages for a particular set of pages

text: I have created some pages (not post) in wordpress related to my college notes. I would like to display a copyright message of the college on this pages, but I don't want do this manually every time. So is there any plug-in or tweak available to achieve this?


title: Move title "meta box" in post mode

text: I've created a custom post type with my own custom meta boxes. Now I want to move the title box to the side or simply remove it and place the same content in a custom meta box. How do I go about to do this? Thanks


title: Use Same Settings for All Inserted Media?

text: When you insert a bunch of images into a Wordpress post via "Add Media," you can hit Shift or Ctrl and select several of them at the same time. But is there a way to be able to set the same "Attachment Display Settings" for all of these images? Like, you highlight all of the images you want, select "Medium," and then that setting gets applied to all of the images you have selected so that they're all "Medium" for their individual dropdown? Thanks!


title: Targeting specific menu with wp_nav_menu_items

text: Hey! I have added a wp_loginout() to my header using a snippet in my functions.php:                   add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2);     function add_login_logout_link($items, $args) {                  ob_start();             wp_loginout('index.php');             $loginoutlink = ob_get_contents();             ob_end_clean();                  $items .= '<li>'. $loginoutlink .'</li>';              return $items;     }      The thing is that it shows the login link in every one of my three menues:                   function register_main_menus() {        register_nav_menus(           array(              'primary-menu' => __( 'Primary Menu' ),              'secondary-menu' => __( 'Secondary Menu' ),              'footer-menu' => __( 'Footer Menu' ),           )        );     };      I would like to target the wp_nav_menu_items filter to only include the login link in the primary menu. Ideas? Thanks in advance


title: Query with pre_get_posts to get pagination

text:
After pretty much getting everything working with `query_posts`, I noticed my pagination wasn't running. I was told `pre_get_posts` should be the solution. My problems:   1. I don't know how to pass all my criteria `(query_posts(array('post_type' => 'trips', 'types' => $types, 'paged' => $paged,)`in to `pre_get_posts`   2. I can't get it working on (just) the template I want, which is used on a page (`is_page` doesn't work) Any help would be appreciated. This is what's inside functions.php               function bwpm_pre_get_posts($query){         if(!$query->get('posts_page_page'))         $query->set('posts_per_page',1);         }         add_action('pre_get_posts','bwpm_pre_get_posts');      This is what's in the template that is used on the page.               <?php     /*     Template Name: Generic Trips Template     */     ?>     <?php get_header(); ?>                  <?php get_template_part( "beforeloop", "page" ) ?>                                         <?php $types = $post->post_name; ?>               <?php if (have_posts()) : ?>         <?php              $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;             query_posts(array(                  'post_type' => 'trips',                  'types' => $types,                  'paged' => $paged,             ) );         ?>     <?php while (have_posts()) : the_post(); ?>         <article id="post-<?php the_ID(); ?>" class="post">
          <?php endwhile; ?>
     <?php posts_nav_link(' · ', 'previous page', 'next page'); ?>
          <?php endif; wp_reset_query(); ?>             <?php get_template_part( "afterloop", "page" ) ?>           <?php get_footer(); ?>      Update: 11/06/2012 After updating the code to @chipbennet example, the problem still isn't solved as I don't get properly working pagination. The previous link will never appear, and the next link will show the same content on every page. Full page code can be found on http://pastebin.com/NiuSEWia.


title: Can I remove an image from the Gallery without deleting it from the Media Library?

text: From what I've looked, I don't think is built-it. Is there a plugin that implements this feature or a workaround for this? Thanks


title: $wpdb won't insert NULL into table column

text: When i try something like this                   $status = NULL;              $wpdb->update(                 'table',                 array(                      'status' => $status,                 ),                  array( 'id' => 1 )          );      In the 'status' column now i have an empty string `''`, it simply won't set it to NULL. The column can be NULL of course. I've also tested $wpdb->query and $wpdb->prepare and the results are the same. Am i doing something wrong?


title: Front End submission with meta key

text:
I'm working to create a front end custom post type submission from. I already coded checking different tuto. But the form returned not found page upon suvmission, again not inputing any data. Please help me to find out the error if possible.               <?php     if (!isset($_POST['submit'])) {          ?>     <form method="post" action="<?php the_permalink(); ?>">

Mobile No:	<input id="id_meta" type="text" name="wpcf-mob_no" maxlength="100" />

Amount To Load:	<input id="id_meta" type="text" name="wpcf-mob_amount" maxlength="100" />

Connection Type	<select id="id_meta" type="text" name="wpcf-mob_type" maxlength="100" />               <option value="pre_paid">Pre Paid</option>               <option value="post_paid">Post Paid</option>

	<input id="id_meta" type="hidden" name="wpcf-mob_status" maxlength="100" value="pending"/>

	<input id="id_title" type="hidden" name="post_title" maxlength="100" value="<?php echo date('r'); ?>"/>

                       	     <input type="hidden" name="post_type" id="post_type" value="loads" />          <input type="hidden" name="action" value="post" />          <?php wp_nonce_field( 'new-post' ); ?>                      <input type="submit" value="Submit" name="submit"/>

                    </form>          <?php }          else {                  $title = $_POST['post_title'];             $meta_box1 = $_POST['wpcf-mob_no'];             $meta_box2 = $_POST['wpcf-mob_amount'];             $meta_box3 = $_POST['wpcf-mob_type'];             $meta_box4 = $_POST['wpcf-mob_status'];                  $new_post = array(                 'post_title'    => $title,                 'post_status'   => 'publish',           // Choose: publish, preview, future, draft, etc.                 'post_type' => 'loads'  //'post',page' or use a custom post type if you want to         );         //save the new post         $pid = wp_insert_post($new_post);              /* Insert Form data into Custom Fields */         add_post_meta($pid, 'wpcf-mob_no', $meta_box1, true);         add_post_meta($pid, 'wpcf-mob_amount', $meta_box2, true);         add_post_meta($pid, 'wpcf-mob_type', $meta_box3, true);         add_post_meta($pid, 'wpcf-mob_status', $meta_box4, true);                   print '
';         var_dump(array($new_post, $pid));         print '
';     }          ?>


title: RSS Feed has no styles in chrome - function to add one?

text: This is a really bizarre problem. For some reason Chrome does not have any RSS feed formatting? Where as most other browsers do! So it seems from I read online that I have to create my own style sheet for it :/ That's fine, but how can I add my RSS stylesheet to my wordpress RSS feed without manipulating the core files. Is there a function that will allow me to add this style sheet? Thanks for any tips :-)


title: Forum plugin that allows private groups that are invite only

text: I'm looking for a plugin that would allow me to create private groups for discussion that are invite only. These would be for people who have taken a workshop and want to remain in communication with their cohort afterwards. They would need to be invited/added by admin after each workshop and would not communicate with other participants. Anyone have any ideas? Appreciate the help!


title: I would like to remove the url and description from about the header

text: I am using the twenty ten theme. Could someone kindly tell which line / lines to axe to remove that URL and description and move the banner picture to the top of the page. Thanks in advance. Brandon


title: Custom headers in WordPress, are there also custom footers?

text: I’m new to WordPress. I saw a custom header file in the `inc` folder of Twenty Twelve theme. I understand that we can use this custom header in any custom page template instead of header. I have a doubt now, is there any custom footer that also can be used? Why this custom files should be stored in `inc` folder?


title: shortcode not working

text: I m working on content-product of woocommerce and doing shortcode in the template as `echo do_shortcode ('[product_attribute attribute="Grams"]');` where Grams are in my backend as attribute and it hasvalues, but nothing get printed out.Is it a wrong query or i need to do something else?


title: WP redirects pretty permalink to query string

text: I have a custom post type `artist` and a taxonomy `kind_of_art`. I want their permalinks to be like: `%kind_of_art%/%artist%` Therefore I created following rewrite rules:                 add_rewrite_rule(         '([^/]+)/([^/]*)/?',         'index.php?kind_of_art=$matches[1]&post_type=artist&artist=$matches[2]',         'top'         );      If I go to `photography/sam-sample` for example, I am redirected to `?artist=sam-sample`. If I add a front base to my rewrite rule it works. ## Additional info An `artist` post consists of multiple textareas with different content. I use this technique to create virtual subpages (e.g. `press`, `gallery`, `biography`). Of course I need rewrite rules again:                 add_rewrite_tag('%artist_sub_page%', '([^&]+)');       add_rewrite_rule(         '([^/]+)/([^/]*)/([^/]*)',         'index.php?artist=$matches[2]&artist_sub_page=$matches[3]&kind_of_art=$matches[1]',         'top'       );      Funnily enough, _this_ works even without that front base. Any ideas whats wrong? I assume this is an easy issue, but I am no expert in rewrite rules. ## EDIT: I just discovered two things: If I visit my `/photography/sam-sample/` I will be redirected to `?artist=sam- sample`. But if I enter my wanted URL again, I am not redirected and it "works". I guess this is why I already thought a few times that I got it working but a minute later it wasn't ;-) If I visit append any string to my wanted URL structure – e.g. `photography/sam-sample/foo` or `photography/sam-sample/foo/bar` – I am also not redirected. ## EDIT #2: I got it working now with this regex:               ([^/]+)/([^/]*)      By working I mean I can visit `/photography/sam-sample` and it will work. One problem to solve still: In my navigation I create the links dynamically with `get_permalink()`. This function still outputs `?artist=sam-sample` instead my wanted structure.


title: Prepend meta_value to permalink of post

text: I have 2 custom post types `movies` (non-hierarchical) and `series`(hierarchical). Each post from `series`type has a meta field `_movie` which contains a movie ID. I want to specify a custom permalink structure for `series`. What I need to achieve is a link `http://example.com/series/movie_slug/parrent_series_slug/series_slug` (parent_series_slug is the slug of the parent of the series, they are hierarchical, if there isn't any parent, `parrent_series_slug` is omitted). What I have achieved at the moment is `http://example.com/series/parrent_series_slug/series_slug`, which is handled by Wordpress. The question is how to insert `movie_slug` (slug of the post with the ID from meta `_movie`) in the permalink before series slug?


title: How can I change a submenu-item in the WordPress-dashboard to a mainmenu-item?

text: I want to create a custom WordPress-dashboard for one of my cliënts. Now I want to hide the "appearance"-menu in the dashboard, but I want the submenu "Menus" to be visible as a mainmenu-item. The "appearance"-menu is normally automaticly hidden since the client's profile has an editor-role. So I bring the "appearance" menu back for editors like this:               // get the the role object     $role_object = get_role( 'editor' );     // add $cap capability to this role object     $role_object->add_cap( 'edit_theme_options' );      I can hide the other submenu-items with CSS, but then I still got the "appearance"-menu and I don't want the cliënt to change the theme. Is there any solution to make the submenu "Menus" visible as a mainmenu-item?


title: Matching Serialized Arrays with meta_query

text: I've asked a related question previously, but I think I've finally worked out the crux of my issue. I'm using Advanced Custom Fields and have a number of custom fields attached to my post type. I'm trying to alter the URL to receive posts via their custom field and value. And I'm getting really close. This is what's currently in my **functions.php** :               add_action('pre_get_posts', 'my_pre_get_posts');          function my_pre_get_posts( $query ) {         if( is_admin() ) { return; }              $meta_query = $query->get('meta_query'); // get original meta query                  if( isset($_GET['type']) ) {                                          $type = '"' . $_GET['type'] . '"';                        $meta_query[] = array(                 'key'       => 'type',                 'value'     => $type,                 'compare'   => 'LIKE',             );         }         $query->set('meta_query', $meta_query); // update the meta query args         return; // always return     }      Now because ACF uses serialized arrays when dealing with multiple values in custom fields, I'm using the `LIKE` query. The `type` custom field actually accepts multiple values, and I'm able to display posts by one `type` (i.e: women) successfully. > website.com?type=women But when trying to retrieve multiple `type`s (i.e: women,men,boys), this doesn't work. > website.com?type=women,men,boys Now I realise I'm working with serialized arrays here, and if I wanted it to query multiple `type`'s I'd have to explode that `$type` variable, but that doesn't seem to be working either. If anyone can help, I'm desperate for a solution. Thanks! **EDIT | Multiple times for each type:**               $meta_query[] = array(         'relation'  => 'OR',         array(              'key'       => 'type',             'value'     => 'men',         ),         array(              'key'       => 'type',             'value'     => 'women',         ),         array(              'key'       => 'type',             'value'     => 'boys',         ),     );


title: Is it possible to create more than one design in a WordPress theme?

text: I have a HTML website that I need to convert to WordPress. It has three layouts, and each layout has a different menu and design. How I can do this in WordPress?


title: Extract array from custom field

text: I'm using woocommerce product bundles extension. I need to manipulate some informations about bundled post. Actually I found the bundled product container has a hidden custom field named _bundled_ids which in the database has this value a:3:{i:0;i:105;i:1;i:80;i:2;i:70;} For what I understand this value is the list of the ids of the products bundled. How can I extract this infos in a comma separated list of ids (i.e. 105,80,70)? I have tried with get_custom_post_meta() but everything I can get is ARRAY. Hope you can help. Best regards and thanks Carlo EDIT As I already stated I need to get the data stored in this custom field as a comma separated list of numbers. I tried to create a shortcode with this code inside my functions.php file:               add_shortcode('bundled_ids','bundled_ids_func');     function bundled_ids_func() {             $meta_values = get_post_meta( $post->ID , '_bundled_ids' );             $mydata = unserialize($meta_values);              return $mydata;     }      But I get nothing EDIT 2               add_shortcode('bundled_ids','bundled_ids_func');     function bundled_ids_func() {         $meta_values = get_post_meta( get_the_ID() , '_bundled_ids', true );         $id_list = print_r($meta_values, true);              return $id_list;     }      with this code I get this result: Array ( [0] => 105 [1] => 80 [2] => 70 )


title: Display update notification messages like 'What's New'

text: I am about to push out a new update for my plugin. I've used a few functions only available to WordPress 3.8, which is fine because I want to support the latest version. How do I display a message to the user before they update the plugin with a list of _What's New_ , or just a general warning that WordPress 3.8 is required to run the latest version of the plugin? I have attached a screenshot of where I'd like the message to display. Is this something that is displayed based on what you put in the change log of your `readme.txt` in trunk? ![enter image description here](http://i.stack.imgur.com/dlszO.png)


title: Custom taxonomy page uses index.php

text: Read a couple of tutorials (here's one) but I don't understand why I can't make it work. I'm trying to create a page for custom taxonomy terms. Like mysite.com/tag/term or mysite.com/category/term but for my taxonomy. **This is what I've done so far:**   1. I registered the new taxonomy              add_action( 'init', 'register_taxonomy_author' );          function register_taxonomy_author() {          register_taxonomy(  'author', 'post',   //Let WordPress know that the artist   taxonomy has posts     array(         'hierarchical' => false,         'label' => 'Authors', // This tells WordPress how to label the various user interface outlets for the artist taxonomy         'query_var' => true,         'rewrite' => array( 'slug' => 'author', 'with_front' => false ))         );     }        2. Added a new file called taxonomy-author.php and copied+pasted the codes from category.php into it. * * * Now, when I try to view the taxonomy terms (Admin Panel > Posts > Authors > View) I get directed to mysite.com/author/term, which is great. But that page uses index.php instead of taxonomy-author.php. What did I miss? Codex states that index.php should be at the bottom, yet it ignores both taxonomy- author.php and my archive.php.


title: How can I add a Description column to the media library browser screen?

text: I'm trying to display the description of each file on the media library browser screen. I've found some code that adds a filename column, but I'm trying to modify it so that it will display the description field instead of the filename. I'm not quite sure of how to do this. The description column displays, but doesn't actually show the description data for each file. I think I'm getting hung up on this line:               echo substr(strrchr($meta['attachment_content'], '/' ), 1);      but it's possible that there are other issues. Below is the full code:               function description_column($cols) {         $cols["description"] = "Description";         return $cols;     }          function description_value($column_name, $id) {         $meta = wp_get_attachment_metadata($id);         echo substr(strrchr($meta['attachment_content'], '/' ), 1);     }          function description_column_sortable($cols) {         $cols["description"] = "name";         return $cols;     }           function hook_new_media_columns() {         add_filter('manage_media_columns', 'description_column');         add_action('manage_media_custom_column', 'description_value', 10, 2);         add_filter('manage_upload_sortable_columns', 'description_column_sortable');     }          add_action('admin_init', 'hook_new_media_columns');      Thanks for your help!


title: How to exclude a taxonomy term using url alone

text: This may have been answered somewhere but I may not be searching for the right wording or my concept is just way off :-) In a nutshell: If I have a url like this:               http://mysite.com/?taxname=termvalue      wordpress dutifully parses that to arrive at http://mysite.com/taxname/termvalue and shows all posts having that taxonomy term equal to that term value. But I would like to construct a url something like one of these:               http://mysite.com/?taxname=-termvalue     http://mysite.com/?taxname!=termvalue     http://mysite.com/?taxname<>termvalue     http://mysite.com/taxname/-termvalue/      which **excludes** any particular term value (or id). (I know the syntax is wrong but wanted my meaning to be clear.) I do know how to make a custom query with all the arguments as described here: http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters but am hoping for a shortcut where wordpress can directly parse a constructed url like that to exclude and include taxonomy terms in the same url parameter/argument list. Thanks! (btw: I also asked this question on wp.org since it seems like the audiences there and here are mutually exclusive, so hopefully one of them will get an answer.)


title: Social Media within Posts

text:
I have a static front page and on that page I have a div where I run a WP Query to retrieve blog posts This is the code:
     <?php $args = array(         'category_name' => 'whats-new',         'posts_per_page'  => 12         );                 $the_query = new WP_Query( $args ); ?>     <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>

                 <?php the_post_thumbnail('full',  array( 'class' => "attachment-post-thumbnail")); ?>
                     <?php the_post_thumbnail_caption(); ?>                     <a href="<?php the_permalink() ?>">                         <?php the_title(); ?>

                     <a href="<?php the_permalink() ?>">
 200 SHARES

     <?php endwhile;?>
      It loops correctly and displays the information but I have somewhat of a complicated issue (to me anyway). Within that loop I need to figure out some way to have 3 boxes with social media that would just display the newest post/tweet/upload Here is my current screenshot ![enter image description here](http://i.stack.imgur.com/jcDbZ.png) Where it says Twitter I would have Facebook and Twitter. Right now I just have them as posts with the featured image and the text is coming from the image caption. Probably not the best way but I was/am unsure of the best way. Any help would be appreciated


title: Update parent post when updating children of that post or assigning children to that post

text: I have a custom meta box that displays a count of information gathered from the children posts associated with a parent but i need the information within the parent posts meta box to be updated each time a child post is assigned or updated. Is this possible?


title: How to include the parent page link in this wp_nav_menu walker

text: I've got a site with a sidebar of 'sub-navigation' I also need to have those links 'parent page' in the navigation also. So, for example I've got Parent child 1 child 2 child 3 but the php only gives me child 1 child 2 child 3 the code is here -               <nav id="sub-navigation">         <?php wp_nav_menu( array('theme_location' => 'main-navigation', 'container' => '', 'walker' => new Related_Sub_Items_Walker(), 'start_depth' => 1, 'include_parent' => 1, 'strict_sub' => 1, 'only_related' => 1, 'filter' => 0, 'filter_selection' => 0, ) ); ?>     </nav>      Any help would be greatly appreciated. I need it 'within' the navigation due to how I've currently styled the look of it.


title: How can I add a column/s to wp_posts table?

text: I am trying to sync WP with another service that offers an API that allows me to hook up their table's Update, Create, Delete to my sites. So when they create, update, or delete a row on their server, I get details about that update, including the row ID. The way I am thinking of syncing is by using custom post types, and either add a new separate table with post -> api relation like `post_id:1 = api_id:53`. Or alter `wp_posts` table by adding a column containing the api_id. I know I can add metabox which will add that as post_meta but I am not sure how effective will that be and I am pretty sure if I alter `wp_posts`, querying will be a lot faster. So how can I alter `wp_posts` in the WordPress way? If that's not possible, should I add meta boxes or create an entirely new table just for the relation ?


title: Widget control - putting a slideshow in the widget area

text: I am trying to put a slideshow in the widget area of my wordress theme... do you know of anyway to do this instead of html in the widget area? Thanks Kevin


title: wp_mail function not dispatching emails from plugin

text: I am working on a plugin that needs to dispatch an email to the user after they submit a form. I have tried quite a few different things but none of them are working. I have also tested from my local wordpress install and also from a live server. My code in my plugin file looks like this:                   function sendMail() {             wp_mail( $email, 'This is the email subject', 'This is the email message');         }         add_action('plugins_loaded', 'sendMail');      it is called when the form is submitted. If anyone knows how I can get this working it would be a huge help Thanks


title: Error with moving my webhost

text: I've been developping a wordpress webshop for a while now. This week my webhost almost expired, so I've been looking to move to another company because my old one wasn't that good. Today I got my new webhost with the transferred domainname, but the old one is still running (without the domain name). The first weird thing is, when I surf to my webhost by IP, I don't reach my wordpress site anymore but I get the 'Web server's default page': 94.198.164.46 is the IP. This is weird in my opinion, because I didn't change anything. So I tried to move my wordpress site to my new webhost. I have a back-up from the public_html map and the database. But when I try to reach my wordpress site I get this error: 'Error at creating the database connection'. Although my wp-config file is correct I think. Any idea what I can do?


title: How to quickly switch custom post type singular template?

text: I have a custom post type called movies and I need to quickly switch the template that displays the movies cpt on the front end via a link. How can this be done? Files I have: single-movies.php template-movieslanding.php template- movieswholesale.php Functionality: A link group is displayed on each of the three templates as demonstrated below. These links are only displayed to logged in staff. The staff are not technical in the least and need a simplistic solution. Views: Overview | Landing Page | Wholesale When each link is clicked I need to switch to that template. All templates use the same custom post type. Thanks! ~Matt


title: How do I manually revert back to my old theme?

text: After changing themes I get               Fatal error: Call to undefined function add_editor_style() in /mydir/wp-content/themes/evolve/functions.php on line 8      I cannot even login to the administration panel


title: Prohibit saving a post without providing a title

text: How to prevent saving a post without providing a title? Right now it's possible. I want to prevent that. How to achieve this task?