title: get_category_children/ the new get_term_children not work

text:
I have a custom Walker for a Advanced Search, that outputs the categories for multiple search by categories in checkbox. The Problem here is, that i use the get_category_children for the children Categories, but its old, and the new code is get_term_children, but when i replace it with it, then comes a error message, like               Warning: substr() expects parameter 1 to be string, object given in /..../search-fields.php on line 269      But the Search Functionality works. The Code for the Walker Class is:               class Multiple_Walker_Category extends Walker      {          var $tree_type = 'category';     var $db_fields = array ('parent' => 'parent', 'id' => 'term_id');          function start_lvl(&$output, $depth, $args) {          $indent = str_repeat("\t", $depth);     $output .= "$indent
\n";          }          function end_lvl(&$output, $depth, $args) {     $indent = str_repeat("\t", $depth);     $output .= "$indent
\n";          }          function start_el($output, $category, $depth, $args)         {             extract($args);             $cat_name =  esc_attr($category->name);                  $cat_name = apply_filters( 'list_cats', $cat_name, $category );             $cat_children = substr(**get_category_children**( $category->term_id, '', ', '), 0, -2 );                  $output .= "
<input type='checkbox' onchange='toggle( {$category->term_id}, Array( $cat_children, 999 ) )' class='cb-element'  checked='checked' name='cat_{$category->term_id}' id='cat_{$category->term_id}' /> ";                  $output .= "term_id}'>$category->name";          }          function end_el(&$output, $category, $depth, $args) {     $output .= "
\n";     }     }      How can i replace the old with the new term_children. Thanks everyone for the help.                   function adv_form_cats($args = '')         {             $defaults = array(                 'show_option_all' => '',                 'orderby' => 'name',                 'order' => 'ASC',                              'show_last_update' => 0,                 'style' => 'list',                              'show_count' => 0,                 'hide_empty' => 1,                              'use_desc_for_title' => 1,                 'child_of' => 0,                              'feed' => '',                 'feed_image' => '',                               'exclude' => '',                 'hierarchical' => true,                              'title_li' => '',                 'echo' => 0             );                  $r = wp_parse_args( $args, $defaults );                  if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) {                 $r['pad_counts'] = true;             }                  if ( isset( $r['show_date'] ) ) {                 $r['include_last_update_time'] = $r['show_date'];             }                  extract( $r );                  $categories = get_categories($r);                  $output = '';             if ( $title_li && 'list' == $style )                     $output = '
' . $r['title_li'] . '
';                  if ( empty($categories) ) {                 if ( 'list' == $style )                     $output .= '
' . __("No categories","WPL") . '
';                 else                     $output .= __("No categories","WPL");             } else {                 global $wp_query;                      if( !empty($show_option_all) )                     if ('list' == $style )                  $output .= "
<input type='checkbox' id='checkAll' checked='checked' name='checkall'  /> ";                  $output .= "".__('Check All', 'WPL').'';                      if ( is_category() )                     $r['current_category'] = $wp_query->get_queried_object_id();                      if ( $hierarchical )                     $depth = 0;  // Walk the full depth.                 else                     $depth = -1; // Flat.                      $output .= walk_category_new_tree($categories, $depth, $r);             }                  if ( $title_li && 'list' == $style )                 $output .= '

';                  $output = apply_filters('wp_list_categories', $output);                             return $output;         }               function walk_category_new_tree()         {             $walker = new Multiple_Walker_Category;             $args = func_get_args();             return call_user_func_array(array(&$walker, 'walk'), $args);         }


title: Need to setup grid like thumbnail of recent posts on sidebar

text: Something like this, no excerpts or anything else. I couldn't find any plugin that can do it: ![enter image description here](http://i.stack.imgur.com/HbGRS.png)


title: Can't open scheduled posts

text: On the homepage of my website I'm retrieving published and scheduled posts this way:               <?php      global $post;     $args = array('numberposts' => '3', 'category' => $category, 'post_status' => array('publish', 'future' ));     $myposts = get_posts($args);      It works fine, but if I'm not logged in as admin I can't access the whole post. It gives me a 404 error.


title: After changing wp from subdirectory to root I can't preview any changes to a page or post

text: I followed the guideline from WP Codex.   * Changed the site url in general settings   * Copied the .haccess and the index.php files from the subdirectory to the root   * Edited the root index.php (new copied file in root) from: '/wp-blog-header.php' ); to '/subdirectory/wp-blog-header.php' );   * checked the permalink structure. the following code is in the new copied root .haccess file              # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress}      When I navigate the new site my permalinks seem to be working. for example > ruthsabrosa.com/birth-preparation does not show as > subdirectory.ruthsabrosa.com/birth-preparation But now the problems: I need to type in the full old url structure to see the admin bar http://yogaseowp.ruthsabrosa.com/birth-preparation/ When I edit this page or any other page and try to preview changes I get: > You do not have permission to preview drafts. Also after I update the post it successfully updates but when I view the post I am directed to my root url which I expected: **ruthsabrosa.com/birth- preparation/** However my top admin bar is now gone, also this root directory page is not updated. Only my original page: **yogaseowp.ruthsabrosa.com/birth- preparation/** is showing the update and the admin bar. So when someone uses the sites navigation or lands on the **ruthsabrosa.com/birth-preparation/ page** from a search they don't see the updated content. I've been looking at this for several hours and the change made to while logged in to yogaseowp.ruthsabrosa.com/birth-preparation/ seems to eventually appear in the main ruthsabrosa.com/birth-preparation/ page, perhaps it takes about 1 hour for the change to appear. It's incredibly frustrating to make any changes or updates to the website now as I keep having to manually add the complete url with subdiretory to make changes to any page or post, can't preview any change and I am still not convinced all changes will eventually appear in the root directory pages. Any guideance would be appreciated.


title: Temporarily disable user role login and replace with message

text: Is there a simple way to temporarily stop a user role logging in with wordpress? For example, if I have a user role called **media** , how can I block them from logging in? I would like a custom message to appear on the website, for example like 'Site undergoing maintenance' So it looks like this... http://i.imgur.com/nDf7a.jpg The reason why, is because my website is completely locked down from the public using this function...               // LOCK DOWN     add_action('get_header', 'wpq_member_only_site');     function wpq_member_only_site() {         // logged in users or visits to a specified page are allowed         if ( !is_user_logged_in() ) {                  $redirect_after_login = get_home_url();                  // the URL where login/registration takes place             $login_url = wp_login_url( $redirect_after_login );                  // redirect visitors             wp_redirect( $login_url, 302 );             exit;         }     }      But I need to do some maintenence and I'm after a simple way to lock all users out that are the role **media** This is because I wan't **administrators** and **editors** to still have access, but not **media**. Can any one help please? Thanks Josh


title: Cache metadata for set of posts

text: I have a query that can only be done using straight SQL, but I need to loop through the returns as a set of posts. As I understand it, WP_Query automatically gets all the metadata for all the posts retrieved, and caches it for when get_post_meta is called. But since I have to use wpdb->query, I was wondering if there was anyway I could call another function after it with a set of like post ids, which would cache all their meta; this way I don't hit the database for every post in the loop. Right now I am actually inner joining the fields I need from the post_meta, but this just seems like a bad (and messy) idea. Thanks,   Max


title: Rename files on upload

text: I have been trying to rename my images on upload and only piece of code I found was the one that uses a 32char hash.               function make_filename_hash($filename) {        $info = pathinfo($filename);        $ext  = empty($info['extension']) ? '' : '.' . $info['extension'];        $name = basename($filename, $ext);        return md5($name) . $ext;     }     add_filter('sanitize_file_name', 'make_filename_hash', 10);      My php knowledge is very limited and I looked everywhere for an example that uses some random number being generated instead of a hash, without success. My initial idea was to get the db image id and use it as image filename on upload but I got my brain twisted in the process. Anyway at this point I would settle for some sort of numbering system that will increase by one digit on every upload or if that is not possbile at least some random number by using a range, like rand(10000,99999). Any help would be very appreciated thanks a lot ========================================================== Can you read data from a custom table in functions.php and write to it. I'm trying to read a counter from a table set the image to that counter number and update the counter in the db. It doesn't seem to work, the counter increases but the table never gets updated, and no matter what the value in the db is, the counter does not use that value, so this means it's not reading this value either. I just want to know if there is another way to do this to rename files but with a value from my custom table. This is what I got so far. I was thinking maybe I use the wrong hook but at this point I am a bit stuck. Thanks guys.                function make_filename_counter($filename) {              $qry;        $fcnt = 0;        $sql = ("SELECT counter FROM bwbps_filenamecounter WHERE id = 1");        $cnt = mysql_query($sql);        foreach($cnt as $cnt) {           $fcnt = $cnt->counter;        }        $fcnt = $fcnt + 1;        $info = pathinfo($filename);        $ext  = empty($info['extension']) ? '' : '.' . $info['extension'];        $sql = "UPDATE bwbps_filenamecounter SET counter = " . $fcnt . " WHERE id = 1";        $qry = mysql_query($sql);        $fcnt = 0;       return $fcnt . $ext;     }     add_filter('sanitize_file_name', 'make_filename_counter', 10);


title: wp-postratings: list current user's unrated posts

text:
This is the code I use to list current user's rated posts (I use the wp- postratings plugin on my site for rating posts):               <?php     global $wpdb, $current_user;     $userranking = $wpdb->get_results( " SELECT * FROM wp_ratings WHERE rating_userid=$current_user->ID ");     if($userranking) {         foreach ( $userranking as $userranking ) {         echo "
rating_postid). "'>" .get_the_title($userranking->rating_postid). "
";         }       }     ?>      How do I list the posts that the current user has not rated yet?


title: How in insert image path in Wordpress database that will display product image in wp admin not on front end?

text: $insert = $wpdb->insert( $prefix."posts", array("post_title" => $posTitle,"post_content" => $postContent,"post_status" => "publish","post_type" =>"product"));          // select products ID     $select = $wpdb->get_results("SELECT ID AS productsId FROM ".$prefix."posts WHERE post_title='".$posTitle."'");     //echo $select[0]->productsId; die();     // insert Image in pots and product attribute meta posts table      $insertImg = $wpdb->insert($prefix."posts",array("post_status" =>"inherit","post_type" => "attachment","guid" => $postGuid,"post_parent" => $select[0]->productsId ));      I need a small, which table and column I need to insert to display product image in wordpress admin,I insert products by query in wordpress rather than insert product by admin


title: Total Word Count For Posts And Comments By One Author

text: How can I count words in posts + tags + comments and display the number of total words used by each author ?


title: multisite can't import media and users

text: I have recently created my first unmanaged VPS and install WordPress Multisite. Ok is working well, until I try to import other blog content (xml) via wordpress import tool. If I check "Download and import file attachments", it doesn't work, is loading all time.. And if I don't check it, all post, pages and menus are imported, but user and images no. It show me this error: Failed to create new user for John Doe. Their posts will be attributed to the current user. Failed to import Media “1”. what can be causing this?


title: Display child pages in sidebar of parent page in wordpress

text: How to get displayed child pages on parent page and also on child page of that parent in sidebar?Trying to paste code from wp codex page and from several other sites, but with no success.I always get instead of list of child pages, list of parent pages!? what is the problem?Just to mention, maybe is important, all parent pages have its own page-template. example code:                   <?php         if($post->post_parent)         $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else         $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");        if ($children) { ?>     <ul>     <?php echo $children; ?>     </ul>     <?php } ?>      I also try this code which seems to me doing god job, but again I got list of parent pages


title: Sidebar login: How do I get the username to show after "Welcome"?

text:
Yo, Sidebar login used to say "Welcome %username%" without a problem until I applied __() to the "Welcome" string. Since then the welcome message just says "Welcome" (in all languages) but i can't bring that username back in there to save my life. What am I doing wrong? Here's how it looks: function widget_wp_sidebarlogin($args) { global $user_ID, $current_user;                   /* To add more extend i.e when terms came from themes - suggested by dev.xiligroup.com */         $defaults = array(             'thelogin'=>__('Login'),             'thewelcome'=>__('Welcome'),             'theusername'=>__('Username:','sblogin'),             'thepassword'=>__('Password:','sblogin'),             'theremember'=>__('Remember me','sblogin'),             'theregister'=>__('Register','sblogin'),             'thepasslostandfound'=>__('Password Lost and Found','sblogin'),             'thelostpass'=> __('Lost your password?','sblogin'),             'thelogout'=> __('Logout','sblogin')         );              $args = array_merge($defaults, $args);         extract($args);                   get_currentuserinfo();              if ($user_ID != '') {             // User is logged in                  global $current_user;             get_currentuserinfo();                  if (empty($thewelcome)) $thewelcome = str_replace('%username%',ucwords($current_user->display_name),get_option('sidebarlogin_welcome_heading'));                  echo $before_widget . $before_title . __("Welcome") . $user_info->user_login . $after_title;                  if (get_option('sidebar_login_avatar')=='yes') echo '
'.get_avatar($user_ID, $size = '38').'
';                  echo '
';                  if(isset($current_user->user_level) && $current_user->user_level) $level = $current_user->user_level;                  $links = do_shortcode(trim(get_option('sidebarlogin_logged_in_links')));                  $links = explode("\n", $links);             if (sizeof($links)>0)             foreach ($links as $l) {                 $l = trim($l);                 if (!empty($l)) {                     $link = explode('|',$l);                     if (isset($link[1])) {                         $cap = strtolower(trim($link[1]));                         if ($cap=='true') {                             if (!current_user_can( 'manage_options' )) continue;                         } else {                             if (!current_user_can( $cap )) continue;                         }                     }                     // Parse %USERNAME%                     $link[0] = str_replace('%USERNAME%',$current_user->user_login,$link[0]);                     $link[0] = str_replace('%username%',$current_user->user_login,$link[0]);                     // Parse %USERID%                     $link[0] = str_replace('%USERID%',$current_user->ID,$link[0]);                     $link[0] = str_replace('%userid%',$current_user->ID,$link[0]);                     echo '
'.$link[0].'
';                 }              }      Gracias...


title: Proper Way to Modify Plugin

text: What is the best way to modify a plugin? I frequently want to make small changes to one or two functions within a large plugin. This is easily done, but I have to use comments to mark my changes and modify the plugin again after an update. Ideally I'd like to leave the plugin alone and make my changes elsewhere, much like we do with themes and child themes. Can I make a plugin that requires the parent plugin and will override it?


title: Creating a path in a plugin to call a function

text: Okay, let's assume that I want to create a dynamic "printable" page using a system that doesn't play well with wordpress's theming engine, is there a way for me to define a "permalink" in my plugin that will call a predefined function, also in my plugin? If you're familiar with Drupal it's similar to how their hook_menu works, but I only need it on a very limited basis, so it doesn't have to be that robust.


title: Show different theme for admin?

text: I'd like to test some theme changes on my live site, but I obviously don't want regular users seeing any errors that may arise from it. I'd like to just duplicate my theme folder and if I'm logged in as admin, then that theme is shown to me, otherwise, the old theme is shown to my users. Is there a plugin to do this?


title: Multiple Plugins Interacting with Menu

text: Got an issue with the use of multiple plugins interacting with the menu system in WordPress. We are using UberMenu and wanted to use If Menu as well to control the visibility of some of the menu items. However UberMenu overrides If Menu and it can't be used. On the UberMenu forum one of the developers said > Unfortunately it is a limitation of the WordPress menu system that you can > only have one plugin/theme adding settings to a menu item at a time. and mentioned he was working on a work around. I'm curious has anyone else experienced this issue and could anyone offer a suggestion for a work around. Thanks in advance.


title: How do I include a template file while allowing it to render its own dynamic content added via custom box?

text: I have 3 theme files: `header.php`, `navigation.php` and `page.php` `page.php` calls `header.php` They both have content which is added to via a `custom box`. `navigation.php` has some content added to it via a `custom box`. Based on the page being called, I would want to include `navigation.php` within `header.php` as well. How would I do this? I want `navigation.php` to be included into `page.php` while both have content that is added to it via a `custom box`. **My guess** Create a page called 'Navigation', for example. I never display this link in my templates so that it's not used as a page on it's own even though it exists as one. This will allow me to edit its contents. Create another page by whatever name, this would use `page.php`. `page.php` would use some function to include `navigation.php` based on `is_home()`. If that idea is right, can someone please elaborate and give me details on what functions I would use, etc?


title: Get Content Limit?

text: I know this might seem like a silly question, but I've searched online and can't find what I"m looking for. It seems like I've used the following markup before (though modified) to limit the number of words that appear where this snippet is place. Can anyone help? I don't necessarily want to Read More link, just to be able to limit # of words in a few - NOT ALL - of my template files.               <?php the_content(); ?>


title: How to get current post ID in quick edit callback

text:
This question is related to another previously asked question, which is a follow up on an answer. # Task As I want to extend QuickEdit to be something really awesome (and more than just _quick edit_ ), I need the ID of the currently "quick edited" post in my callbacks. ## Core MarkUp From what I can see in core in the `class-wp-posts/terms-list-table.php` file and the `WP_*_List_Table#inline_edit()` function, there're no values for checkboxes, input fields, etc. set via PHP. All are set via JavaScript. The structure looks like that:                    <form id="posts-filter" action method="get">

Post Data

another post... etc.

     </form>     <form method="get" action>

          </form>      ## Custom Quick Edit fields Depending on what and on which list table (post/term) we want to add custom quick edit boxes to, we need to add callbacks to filters. Again, those only work if we got a custom column (see other question).               add_action( 'quick_edit_custom_box', array( $this, 'addFields' ), 10, 3 );     # add_action( 'bulk_edit_custom_box', array( $this, 'addFields' ), 10, 2 );      The callback itself has the actual **_problem I'm facing_**. We have two (or in case of terms, three) arguments: `$postType` and `$columnName`. Both doesn't help me to retrieve the actual `$post_ID`, which I'd need for stuff like the `wp_editor()` for example.               public function addFields( $colName, $postType, $taxonomy = '' )     {         // How to retrieve the ID of the currently quick edited post in here?     }


title: How to add the source url as custom field in autoblogged Wordpress plugin

text:
My website working on Autoblogged plugin and the theme installed is iPin Pro. I wanted to autoblogged posts to add source url also, in page shows uploaded by user. please help. I wanted to "uploaded by user" to autoblogged custom field value, screenshot attached here http://imgur.com/EOxtrje ,my autoblogged custom page screen shot is here- http://i.imgur.com/LlA2HTN.jpg?1 What are the values in custom field? Here is the source page of page_source.php in theme               <?php     /*     Template Name: _source     */     ?>          <?php get_header(); global $user_ID, $wp_rewrite; ?>
         <?php         if(isset($wp_query->query_vars['domain'])) {             $source = rawurlencode($wp_query->query_vars['domain']);         } else {             $source = '...';         }         ?>

<?php _e('Pins from', 'ipin') ?> <a href="http://<?php echo $source; ?>" target="_blank"><?php echo $source; ?>

              <?php         $pnum = intval($_GET['pnum']) ? $_GET['pnum'] : 1;         $args = array(             'meta_key' => '_Photo Source Domain',             'meta_value' => $source,             'paged' => $pnum         );              query_posts($args);         $maxpage = $wp_query->max_num_pages;         ?>

             <?php $count_ad = 1; if (have_posts()) : while (have_posts()) : the_post(); ?>                  <?php if (of_get_option('frontpage1_ad') == $count_ad && of_get_option('frontpage1_ad_code') != '' && ($pnum == 1  || of_get_option('infinitescroll') == 'disable')) { ?>

                                   <?php eval('?>' . of_get_option('frontpage1_ad_code')); ?>

             <?php } ?>                  <?php if (of_get_option('frontpage2_ad') == $count_ad && of_get_option('frontpage2_ad_code') != '' && ($pnum == 1  || of_get_option('infinitescroll') == 'disable')) { ?>

                                   <?php eval('?>' . of_get_option('frontpage2_ad_code')); ?>

             <?php } ?>                  <?php if (of_get_option('frontpage3_ad') == $count_ad && of_get_option('frontpage3_ad_code') != '' && ($pnum == 1  || of_get_option('infinitescroll') == 'disable')) { ?>

                                   <?php eval('?>' . of_get_option('frontpage3_ad_code')); ?>

             <?php } ?>                  <?php if (of_get_option('frontpage4_ad') == $count_ad && of_get_option('frontpage4_ad_code') != '' && ($paged == 0 || $paged == 1 || of_get_option('infinitescroll') == 'disable')) { ?>

                                   <?php eval('?>' . of_get_option('frontpage4_ad_code')); ?>

             <?php } ?>                  <?php if (of_get_option('frontpage5_ad') == $count_ad && of_get_option('frontpage5_ad_code') != '' && ($paged == 0 || $paged == 1 || of_get_option('infinitescroll') == 'disable')) { ?>

                                   <?php eval('?>' . of_get_option('frontpage5_ad_code')); ?>

             <?php } ?>                  <div id="post-<?php the_ID(); ?>" <?php post_class('thumb'); ?>>

                         <?php if (current_user_can('administrator') || current_user_can('editor') || current_user_can('author') || !is_user_logged_in()) { ?>                         <a class="ipin-repin btn btn-mini" data-post_id="<?php echo $post->ID ?>" href="#"> <?php _e('Repin', 'ipin'); ?>                         <?php } ?>                         <?php if ($post->post_author != $user_ID) { ?>                          <button class="ipin-like btn btn-mini<?php if(ipin_liked($post->ID)) { echo ' disabled'; } ?>" data-post_id="<?php echo $post->ID ?>" data-post_author="<?php echo $post->post_author; ?>" type="button"> <?php _e('Like', 'ipin'); ?></button>                         <?php } else { ?>                         <a class="btn btn-mini" href="<?php echo home_url('/pins-settings/'); ?>?i=<?php the_ID(); ?>"><?php _e('Edit', 'ipin'); ?>                         <?php } ?>                         <a class="ipin-comment btn btn-mini" href="<?php the_permalink(); ?>#respond" data-post_id="<?php echo $post->ID ?>"> <?php _e('Comment', 'ipin'); ?>
                          <a class="featured-thumb-link" href="<?php the_permalink(); ?>">                         <?php                         if (of_get_option('price_currency') != '') {                             remove_filter('the_title', 'ipin_the_title');                             $title_unfiltered = get_the_title();                             preg_match_all('/\$[0-9,]+(?:\.[0-9]{2})?/', $title_unfiltered, $match);                             add_filter( 'the_title', 'ipin_the_title');                             if ($match[0]) {                         ?>

<?php echo str_replace('$', of_get_option('price_currency'), array_pop($match[0])); ?>

                         <?php                             }                         }                         ?>                              <?php                         //if is youtube or vimeo video                         $photo_source = get_post_meta($post->ID, "_Photo Source", true);                         if (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', str_replace('&', '&', $photo_source), $match) || (strpos(parse_url($photo_source, PHP_URL_HOST), 'vimeo.com') !== FALSE && sscanf(parse_url($photo_source, PHP_URL_PATH), '/%d', $video_id))) {                         ?>

                         <?php } ?>                              <?php                         $imgsrc = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID),'medium');                         if ($imgsrc[0] == '') {                             $imgsrc[0] = get_template_directory_uri() . '/img/blank.gif';                         }                              //if is animted gif                         $animated_gif = false;                         if (substr($imgsrc[0], -4) == '.gif' && get_post_meta(get_post_thumbnail_id($post->ID), 'a_gif', true) == 'yes') {                                 $animated_gif = true;                                 $animated_gif_imgsrc_full = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');                                 echo '

';                              }                         ?>                         <img class="featured-thumb<?php if ($animated_gif) echo ' featured-thumb-gif-class" data-animated-gif-src-medium="' . $imgsrc[0] .  '" data-animated-gif-src-full="' . $animated_gif_imgsrc_full[0]; ?>" src="<?php echo $imgsrc[0]; ?>" alt="<?php the_title_attribute(); ?>" style="width:<?php echo $imgsrc[1] ?>px;height:<?php echo $imgsrc[2] ?>px" />                                               <div class="post-title" data-title="<?php esc_attr_e($title_unfiltered); ?>">                         <?php                         $post_title_strip_tags = get_the_title();                         if (of_get_option('posttags') == 'enable') {                             $post_title_strip_tags = preg_replace('/tags\[(.*?)\]/', '', get_the_title(), 1);                         }                              echo mb_strimwidth(strip_tags($post_title_strip_tags), 0, 255, ' ...');                              $posttags = get_the_tags();                         if ($posttags) {                             echo '

';                                  foreach($posttags as $tag) {                                 echo 'term_id). '">' . $tag->name . ' ';                              }                                  echo '
';                         }                         ?>

                      <?php                  $likes_number = get_post_meta($post->ID, '_Likes Count', true);                 $repins_number = get_post_meta($post->ID, '_Repin Count', true);                 $comments_number = get_comments_number();                 ?>
                 <?php                     if ($likes_number == '' || $likes_number == '0') {                         echo 'ID . '" class="likes-count hide">';                     } elseif ($likes_number == '1') {                         echo 'ID . '" class="likes-count">1 ' . __('like', 'ipin') . '';                     } else {                         echo 'ID . '" class="likes-count">' . $likes_number . ' ' . __('likes', 'ipin') . '';                     }                          if ($comments_number == '0') {                         echo 'ID . '" class="comments-count hide">';                     } elseif ($comments_number == '1') {                         echo 'ID . '" class="comments-count">1 ' . __('comment', 'ipin') . '';                     } else {                         echo 'ID . '" class="comments-count">' . $comments_number . ' ' . __('comments', 'ipin') . '';                     }                          if ($repins_number == '' || $repins_number == '0') {                         echo 'ID . '" class="repins-count hide">';                     } elseif ($repins_number == '1') {                         echo 'ID . '" class="repins-count">1 ' . __('repin', 'ipin') . '';                     } else {                         echo 'ID . '" class="repins-count">' . $repins_number . ' ' . __('repins', 'ipin') . '';                        }                 ?>

                     <?php if (current_user_can('administrator') || current_user_can('editor') || current_user_can('author') || !is_user_logged_in()) { ?>                     <a class="ipin-repin btn btn-small" data-post_id="<?php echo $post->ID ?>" href="#"><?php _e('Repin', 'ipin'); ?>                     <?php } ?>                     <?php if ($post->post_author != $user_ID) { ?>                      <button class="ipin-like btn btn-small<?php if(ipin_liked($post->ID)) { echo ' disabled'; } ?>" data-post_id="<?php echo $post->ID ?>" data-post_author="<?php echo $post->post_author; ?>" type="button"><?php _e('Like', 'ipin'); ?></button>                     <?php } else { ?>                     <a class="btn btn-small" href="<?php echo home_url('/pins-settings/'); ?>?i=<?php the_ID(); ?>"><?php _e('Edit', 'ipin'); ?>                     <?php } ?>                     <a class="ipin-comment btn btn-small" href="<?php the_permalink(); ?>#respond" data-post_id="<?php echo $post->ID ?>"><?php _e('Comment', 'ipin'); ?>

<a href="<?php echo home_url('/' . $wp_rewrite->author_base . '/') . get_the_author_meta('user_nicename'); ?>/"><?php echo get_avatar(get_the_author_meta('ID'), '30'); ?>

                         <?php the_author_posts_link(); ?>                          <?php                              $original_post_id = get_post_meta($post->ID, "_Original Post ID", true);                             if ($original_post_id != '' && $original_post_id != 'deleted') {                                 $original_postdata = get_post($original_post_id, 'ARRAY_A');                                 $original_author = get_user_by('id', $original_postdata['post_author']);                             ?>                             <?php _e('via', 'ipin'); ?>                              <a href="<?php echo home_url('/' . $wp_rewrite->author_base . '/') . $original_author->user_nicename; ?>/"><?php echo $original_author->display_name; ?>                             <?php                             }                             if ($board_info = get_the_terms($post->ID, 'board')) {                                 _e('onto', 'ipin');                                 foreach ($board_info as $board) {                                 ?>                                  <a href="<?php echo home_url('/board/'); ?><?php echo $board->term_id ?>/"><?php echo $board->name; ?>                                 <?php                                 }                             }                         ?>

                      <?php                 if ('0' != $frontpage_comments_number = of_get_option('frontpage_comments_number')) {                 ?>                  <div id="masonry-meta-comment-wrapper-<?php echo $post->ID; ?>">                  <?php                     if ($comments_number >  $frontpage_comments_number) {                         $offset = $comments_number - $frontpage_comments_number;                     } else {                         $offset = 0;                         }                          $args = array(                         'number' => $frontpage_comments_number,                         'post_id' => $post->ID,                         'order' => 'asc',                         'offset' => $offset,                         'status' => 'approve'                     );                     $comments = get_comments($args);                     foreach($comments as $comment) {                     ?>
                         <?php $comment_author = get_user_by('id', $comment->user_id); ?>
                             <?php if ($comment_author) { ?>                             <a href="<?php echo home_url('/' . $wp_rewrite->author_base . '/') . $comment_author->user_nicename; ?>/">                             <?php } ?>                                 <?php echo get_avatar($comment->user_id, '30'); ?>                             <?php if ($comment_author) { ?>                                                          <?php } ?>

                                                              <?php if ($comment_author) { ?><a href="<?php echo home_url('/' . $wp_rewrite->author_base . '/') . $comment_author->user_nicename; ?>/"><?php } ?><?php echo $comment->comment_author; ?><?php if ($comment_author) { ?><?php } ?>                                                          <?php echo $comment->comment_content; ?>

                     <?php                      }                     ?>
                 <?php                 }                       if (is_user_logged_in()) {                 ?>                 <div id="masonry-meta-commentform-<?php echo $post->ID ?>" class="masonry-meta hide">
<?php echo get_avatar($user_ID, '30'); ?>

                     <?php                      $id_form = 'commentform-' . $post->ID;                     $id_submit = 'submit-' . $post->ID;                          comment_form(array(                         'id_form' => $id_form,                         'id_submit' => $id_submit,                         'title_reply' => '',                         'cancel_reply_link' => __('X Cancel reply', 'ipin'),                         'comment_notes_before' => '',                         'comment_notes_after' => '',                         'logged_in_as' => '',                         'label_submit' => __('Post Comment', 'ipin'),                         'comment_field' => '<textarea placeholder="' . __('Add a comment...', 'ipin') . '" id="comment" name="comment" aria-required="true"></textarea>'                     ));                     ?>

                 <?php } ?>
             <?php             $count_ad++;             endwhile;              else :             ?>

<?php _e('Nothing yet . . .', 'ipin'); ?>

             <?php              endif;             wp_reset_query();              ?>
              <?php if ($maxpage != 0) { ?>

                           <?php if ($pnum != 1 && $maxpage >= $pnum) { ?>
                     <a href="<?php $permalink = get_permalink(); if (substr($permalink,-1) == '/') { $permalink = substr($permalink,0,-1); } echo $permalink . '/' . $source . '?pnum=' . ($pnum-1); ?>"><?php _e('« Previous', 'ipin') ?>
                 <?php } ?>                      <?php if ($maxpage != 1 && $maxpage != $pnum) { ?>
                     <a href="<?php $permalink = get_permalink(); if (substr($permalink,-1) == '/') { $permalink = substr($permalink,0,-1); } echo $permalink . '/' . $source . '?pnum=' . ($pnum+1); ?>"><?php _e('Next »', 'ipin') ?>
                 <?php } ?>

         <?php } ?>

<?php _e('Top', 'ipin'); ?>

              <?php get_footer(); ?>


title: How to make use of WP templates within a nested site structure?

text: I am working on a site that highlights neighborhoods. Within each neighborhood there are places (that will be added by the client on the back end). Each neighborhood will have its own unique set of places. I figured out how to lead a list of all neighborhoods (neighborhood.php) to it's specific single neighborhood (single-neighborhood.php). However once i get into a single neighborhood i don't understand how to create a link to a list of places (which would be a Custom Post Type) that would then link to their single place page. I was considering using the concept of creating a Places Custom Post Type and then a single-place.php page template but i'm wondering how WordPress would interpret that and how it would lead to the correct post. Here is an image that shows the heirarchy, i have completed levels 1 through 3 and am trying to figure out 4-5. ![Quick Map Site Structure](http://i.stack.imgur.com/VagNu.png) I know how to create Custom Post Types, I know how to make custom fields, I know how to connect the custom fields to templates. What i don't know and am trying to figure out is how to link to the single places from a specific neighborhood? How does wordpress understand what Place post to go to? In Summary I:   1. Created 27 neighborhoods   2. Each neighborhood has a sub navigation that leads to "Places" "History" "Gallery" "Points of Interest"   3. I need to figure out how to link a list of Places to the "Places" sub nav link and have it pull the content from a specific Place Custom post and then have that list lead to a single place page I understand the concept of neighborhood.php template permalinking to single- neighborhood.php but i don't get how to make a further nested site heirarchy work under this logic would it still be place.php to single-place.php? If so how do i link to a list of places relevant to specific neighborhoods within the single-neighborhood page? Thank you.


title: How do I fully migrate post images from one WordPress site to another?

text: I know WordPress has a built-in tool for exporting content, but this does not actually export images associated with each post...it only exports an XML file. How do I actually export images in each post and upload them to my new WordPress site?


title: Multi site and media uploader

text: There seems to be a strange issue with my multisite on my live blog. Maybe its because I have one site set to "deleted" - so I can edit it, but the public can't see it? My current upload is set up as such: `wp-content/blogs.dir/10/files` This gives me a link such as (the link is real, I replaced my site address with example.com): `http://example.com/files/2013/01/Screenshot- from-2013-01-04-141248-300x150.png` This works on every single site I have, I recently created a new site and uploading images via the uploaded shows me a broken image and the console states it cannot find it. So I went to FPT and went into blogs.dir (stored at the base of wp-content) and went to site 10 and sure enough, under `files/2013/03/` are the files I have uploaded. I then went to my media uploader, looked at the broke image and clicked view, this showed me that the image was going from `example.com/files/2013/03/` \- this is simmilar to all the other sites I have on the network, they all map images like this and the images work. My next suspicion was file permissions, I checked the permission of "10" folder, it was not same as the rest so I did `sudo chown -R user-name 10` which changed the owner from apache to me. Still the images get uploaded yet they are "broken" as in they cannot be found. So I come to you guys to ask, **what's going on?**


title: Disqus Comment System not working

text: I've recently got myself Disqus for my blog. Worked fine until today. I don't know what I did - I tried disabling all the plugins, switching between versions 2011 and 2012. Also cleared the cache and paused Cloudflare. Not Working! :( Please have a look at my website and see what's the problem! Disqus doesn't seem to work at all!


title: How do I display the latest posts from three different categories?

text:
I'm trying to set up the homepage of my site in this manner. Right now, the only post on the homepage contains an article with an podcast. To make it simple, The podcast has two people discussing sports and they want to write their commentary for each podcast. I created a separate category for each person and I'd like to display their commentaries below the podcast as below. Podcast, Steve's commentary, Matt's commentary I haven't worked much with the Loop and like I said I have only the latest podcast article but now I need to add the two commentaries, 1 from each category. Can anyone help me, i'm really confused ? I've posted my existing loop               <?php      query_posts('category_name=Weekly Show&showposts=1');     if (have_posts()) : while (have_posts()) : the_post(); ?>

     <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>">     <?php the_title(); ?>
     <?php ob_start(); ?>     <?php $icons = array(); ?>     <?php if (!is_page()): ?><?php ob_start(); ?><img src="<?php bloginfo('template_url'); ?>/images/PostDateIcon.png" width="18" height="18" alt="" />     <?php the_time(__('F jS, Y', 'kubrick')) ?>     <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page()): ?>    <?php ob_start(); ?><?php _e('Author', 'kubrick'); ?>: <?php the_author_posts_link() ?>     <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (current_user_can('edit_post', $post->ID)): ?><?php ob_start(); ?><?php edit_post_link(__('Edit', 'kubrick'), ''); ?>     <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
     <?php echo implode(' | ', $icons); ?>
     <?php endif; ?>     <?php $metadataContent = ob_get_clean(); ?>     <?php if (trim($metadataContent) != ''): ?>
     <?php echo $metadataContent; ?>
     <?php endif; ?>
                <?php if (is_search()) the_excerpt(); else the_content(__('Read the rest of this entry »', 'kubrick')); ?>           <?php if (is_page() or is_single()) wp_link_pages(array('before' => '
Pages: ', 'after' => '
', 'next_or_number' => 'number')); ?>

     <?php ob_start(); ?>     <?php $icons = array(); ?>     <?php if (!is_page()): ?><?php ob_start(); ?><img src="<?php bloginfo('template_url'); ?>/images/PostCategoryIcon.png" width="18" height="18" alt="" />     <?php printf(__('Posted in %s', 'kubrick'), get_the_category_list(', ')); ?>     <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && get_the_tags()): ?><?php ob_start(); ?><img src="<?php bloginfo('template_url'); ?>/images/PostTagIcon.png" width="18" height="18" alt="" />     <?php the_tags(__('Tags:', 'kubrick') . ' ', ', ', ' '); ?>     <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && !is_single()): ?><?php ob_start(); ?><img src="<?php bloginfo('template_url'); ?>/images/PostCommentsIcon.png" width="18" height="18" alt="" />     <?php comments_popup_link(__('No Comments »', 'kubrick'), __('1 Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?>     <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
     <?php echo implode(' | ', $icons); ?>
     <?php endif; ?>     <?php $metadataContent = ob_get_clean(); ?>     <?php if (trim($metadataContent) != ''): ?>
     <?php echo $metadataContent; ?>
     <?php endif; ?>

          <?php comments_template(); ?>     <?php endwhile; endif; ?>
     <?php include (TEMPLATEPATH . '/sidebar2.php'); ?>

          <?php get_footer(); ?>


title: Add new page with preselected parent

text: I do not want my clients to select a parent page from the drop down list, when creating a child page, so I would like to create a link on the dashboard which links to "add new page" - but with a preselected parent page. Is this possible? And if not, then is there a way to change the default parent from "(no parent)" to a parent of my choice?


title: Getting all ID's matching a title in a custom post type

text: I am trying to pull out all post ID's that have the same post title. This is in a custom post type called 'course-manager'. Here is what I have so far:                   $pages = array();              $args1 = array(             'post_type' => 'course-manager',             'posts_per_page' => -1,         );         query_posts( $args1 );         $page = get_page_by_title( $current_post_title, 'OBJECT', 'course-manager' );         while ( have_posts() ) : the_post(); //query all pages and get id's of pages with the specific title. Put id's in an array and use array in query below to query each id                     $pages[] = $page->ID;             echo $page->ID;              endwhile;         wp_reset_postdata();      This should work in my opinion. I have four posts - two with the title I am searching for and 2 with a different title... however instead of getting the two differnt post ID's I want, I am getting 4 post ID's all the same. :/ Thanks


title: How can I find plugins' slug?

text: I'm wondering how can I find plugins' slug (slug = internal name used by WordPress to do plugin updates and to determine which plugins are currently active)? It is usually plugin's folder name but if a plugin doesn't have a folder, it is its file name (like hello.php). Are there any other exceptions?   1. Do lowercase and uppercase characters matter?   2. Can a plugin have different slug than its folder name? What if there's a plugin called hello.php and another /hello.php/hello.php?


title: WP Build-In Post selector for CPT

text: I'm quite sure to remember any WP build-in function that generates post selector based on several args (post_type, etc.) like on the nav-menus admin page, here a screenshot: ![enter image description here](http://i.stack.imgur.com/SNiFI.jpg) Is there something like this or must I have been dreaming about it? How would you implement this?


title: Moving a WordPress site - Installation issue

text: I have moved Wordpress sites before and have occasionally encountered issues but always been able to resolve them. I have tried to do this several times with this site but I am still having the same problem installing WordPress at the new location. My database seems to move over no problem and I can login to my site at the admin but if I try to visit my site I just get the "index of" list of files. I have put the contents of the WordPress install folder into /public_html/tassolarpanels.com.au. and I have added .htaccess file with 'DirectoryIndex index.php index.html' and I am still having no success. Does any one know where my issue might be? I've tried following so many different instructions on moving wordpress and I can't figure out where I'm going wrong!


title: Multi language site using only .mo and WPLANG

text: Hello world/ Bonjour le monde, What technical limitations exist that would prevent the following from working (assume all static content with translations made in .mo file) Pseudo code: For every request:   * Check if query string contains field :myLang:   * If value of :myLang: equals "en_US"   * Then ~somehow change WPLANG to "en_Us"   (Or force Wordpress to behave as if WPLANG was actually set to '')   * Else- serve request as French using the fr_FR.mo as defined in wp-config.php I am vaguely aware that it has something to do with the way Wordpress is initialized. I know WPLANG can't be changed on the fly.


title: Admin pages have no content

text: Not the usual white screen of whatever horror, my site is shown normally until you go to the admin dashboard. While the dashboard (or the admin menu if you will) is visible and responds accordingly, the content is not shown for any of the sections/pages. Except for one two things: adding a post and editing an old one. And so, this is what I get: http://dumpt.com/img/files/jdyvf8206fkmi1w01e6u.png The page update animation just rolls and rolls without any actual changes even made. Haven't found any discussions about the said problem anywhere so... Need help :D


title: admin page passing $_POST variables to itself

text:
I'm new to wordpress but I really like this and I would love to write my applications inside of wordpress. However there are still many things to learn and after a while one can lose it's head, as I just did. I've been searching for a sollution the last 2 day's on a very simple problem. I want to reload an admin page and pass $_POST variables. Actually I want to write a little crm program inside the admin panel as it is nicely put away from the public (front) section. Maybe this is not the right way to work, if it isn't please let me know. The first problem I'm facing is that I can't seem to pass the $_POST variables naam and voornaam when reposting the page. As wordpress passes the page itself as a variable. this is the simple code:               /** Step 2 (from text above). */     add_action( 'admin_menu', 'patientenbeheer' );          /** Step 1. */     function patientenbeheer() {         add_menu_page(__('patientenbeheer'), __('patientenbeheer'),'manage_options', basename(__FILE__), 'patientenbeheer_options');     }                     /** Step 3. */     function patientenbeheer_options() {         if ( !current_user_can( 'manage_options' ) )  {         wp_die( __( 'You do not have sufficient permissions to access this page.' ) );     }     ?>

<?php _e('patientenbeheer'); ?>

            <form action="" method="post" enctype="multipart/form-data">
naam: <input type="text" name="naam" value="" /> voornaam: <input type="text" name="vnaam" value="" />
             <input type="submit" value="Submit" />         <?php         if ( isset($_POST)) {             if (! isset($_POST['vnaam'])){                 echo "
 naam: ".$_POST['naam']."
";             }elseif ( ! isset($_POST['naam'])){                 echo "
 vnaam: ".$_POST['vnaam']."
";             } else {                 echo "
 beide
";             }         }         ?>
         </form>
             reload returns this: ../wp-admin/admin.php?page=martial-patientenbeheer.php if I change the form tag to this: I get: ../wp- admin/admin.php?naam=naam&vnaam= the $_POST values are include but the link is missing the page: martial- patientenbeheer.php. It shoud reload to: ../wp-admin/admin.php?page=martial- patientenbeheer.php?naam=naam&vnaam= Is this possible or is my working method wrong? putting it more simply, I want to add text to my page each time variables are passed. Text being the info from a sql select query or fields to add a new patient.


title: Get query result before posts are displayed?

text: If I want to modify the query, I can use `pre_get_posts` filter. But what if I want to loop through the queried posts before they are ran through the `The Loop`? Is there a filter/action hook for that? I want to find out if all the queried posts belong to same `term` and then do something if they are not. Please note that creating a custom `Query` is not an option.


title: Change order of Custom Taxonomy List

text: By default WordPress orders custom taxonomies (as tags in this case) by alphabetical order not by the order they were entered in the tag box. Is anyone aware of a way to show the custom taxonomies in the order they were entered in the post edit screen? The url in question is: http://granadatheater.com/ The GGW (Goes Good With) artists are currently in alphabetical order and they want it changed so that they are ordered the same way they were entered. So if the enter it Artist1, Artist3, Artist2 that's how it should show up on the frontend of the site.


title: How to unindex a single blog in Multisite?

text: Is there anyway to un-index a single blog in Multisite from search engines ?


title: Custom taxonomy list in two columns

text:
I am using this to get taxonomy list. For each post, there are more than 20 terms. How can I get them in two columns.               echo '
'; echo strip_tags( get_the_term_list( $post->ID, 'trade', '
', '

', '
' ) ,'
'); echo '
';


title: Rename "Portfolio" slug?

text: I have a WordPress theme that I am working with called "Forte". Yes, it is a premium theme. I have reached out to the developer but apparently he doesn't really want to help in this situation. Well I need to change the "portfolio" slug to something else. "Portfolio" doesn't really work at all with the website I am working on. In the past what I've done is find `‘rewrite’ => array(“slug” => “portfolio”),` in `functions.php` and I would change it to `‘rewrite’ => array(“slug” => “NEW-SLUG-NAME”),`. However, in this theme the developer seems to do it differently. Below is the code in a file called `pix_post-types.php` which seems to handle this. I am not a PHP developer but I can do a good deal of editing and understand it more-or-less. I would really appreciate some help!               <?php     add_action('init', 'register_testimonial');          function register_testimonial() {       $args = array(         'labels' => array(       'name' => __( 'Testimonials' ),        'singular_name' => __( 'Testimonial' ),       'add_new' => _x('Add new', 'testimonial'),       'add_new_item' => __('Add a new testimonial'),        'edit_item' => __('Edit testimonial'),       'new_item' => __('New testimonial'),       'view_item' => __('View testimonial'),       ),     'capability_type' => 'page',     'has_archive' => false,     'hierarchical' => false,     'menu_position' => 22,     'public' => false,     'singular_label' => __('Testimonial'),     'show_ui' => true,     'supports' => array(       'title',       'thumbnail',       'editor',       'custom-fields',       'revisions')       );            register_post_type( 'testimonial' , $args );     }          add_action('init', 'register_portfolio');          function register_portfolio() {       $args = array(     'labels' => array(       'name' => __( 'Portfolio' ),        'singular_name' => __( 'Portfolio' ),       'add_new' => _x('Add new', 'portfolio'),       'add_new_item' => __('Add a new item'),        'edit_item' => __('Edit item'),       'new_item' => __('New item'),       'view_item' => __('View item'),       ),     'capability_type' => 'page',     'has_archive' => true,     'hierarchical' => false,     'menu_position' => 20,     'public' => true,     'rewrite' => true,     'singular_label' => __('Portfolio'),     'show_ui' => true,     'supports' => array(       'title',       'thumbnail',       'editor',       'excerpt',       'trackbacks',       'custom-fields',       'comments',       'revisions')       );                register_post_type( 'portfolio' , $args );         }          add_action( 'init', 'create_portfolio_taxonomies', 0 );          //create two taxonomies, genres and writers for the post type "book"     function create_portfolio_taxonomies()      {       // Add new taxonomy, make it hierarchical (like categories)       $labels = array(     'name' => _x( 'Galleries', 'taxonomy general name' ),     'singular_name' => _x( 'Gallery', 'taxonomy singular name' ),     'search_items' =>  __( 'Search Gallery' ),     'all_items' => __( 'All Galleries' ),     'parent_item' => __( 'Parent Gallery' ),     'parent_item_colon' => __( 'Parent Gallery:' ),     'edit_item' => __( 'Edit Gallery' ),      'update_item' => __( 'Update Gallery' ),     'add_new_item' => __( 'Add New Gallery' ),     'new_item_name' => __( 'New Gallery Name' ),     'menu_name' => __( 'Galleries' ),       );                register_taxonomy('gallery',array('portfolio'), array(     'hierarchical' => true,     'labels' => $labels,     'show_ui' => true,     'query_var' => true,     'rewrite' => array('hierarchical' => true )       ));            // Add new taxonomy, NOT hierarchical (like tags)       $labels = array(     'name' => _x( 'Tags', 'taxonomy general name' ),     'singular_name' => _x( 'Tag', 'taxonomy singular name' ),     'search_items' =>  __( 'Search tags' ),     'popular_items' => __( 'Popular tags' ),     'all_items' => __( 'All tags' ),     'parent_item' => null,     'parent_item_colon' => null,     'edit_item' => __( 'Edit tag' ),      'update_item' => __( 'Update tag' ),     'add_new_item' => __( 'Add New tag' ),     'new_item_name' => __( 'New tag name' ),     'separate_items_with_commas' => __( 'Separate tags with commas. They will be used for filtering portfolio items' ),     'add_or_remove_items' => __( 'Add or remove tags' ),     'choose_from_most_used' => __( 'Choose from the most used tags' ),     'menu_name' => __( 'Tags' ),      );             register_taxonomy('portfolio_tag','portfolio',array(     'hierarchical' => false,     'labels' => $labels,     'show_ui' => true,     'query_var' => true,     'rewrite' => array( 'slug' => 'portfolio_tag' ),       ));          }                      /*=========================================================================================    */          ?>


title: login in wordpress using gmail account

text: I implementing log in in my WordPress website for only company employees. I want user can only log in with company given Gmail Email id and no one else can see the details of website what should i do .I m new on this please help me. Thank in advance....


title: Migrating only media files

text: I have sort of a specific situation. I want to move my Wordpress site to a new hosting situation. The site has had weird problems in the past, so I was planning to do a fresh installation of Wordpress and rebuild the site to avoid bringing any baggage along. However, I'll want to recreate some of the pages exactly. To make the process easier I would like to just copy and paste the HTML of those pages straight over. The only problem is that the image URLs won't be the same. Can I just copy my media files over to the new Wordpress installation so that the image URLs will be the same? Or is there some problem with that?


title: Embed YouTube video from custom field value

text: I'm collecting Youtube video links in custom fields, but when I echo out the value it just prints the URL. How do I get WordPress to convert it to be embedded? Example:               <?php global $post;     $video = get_post_meta( $post->ID, '_my_video_link', true );     echo ( $video ); ?>      Just outputs `http://www.youtube.com/watch?v=tkEvSjdDfiA` But I want it to display the actual video... Thanks for any advice


title: I have a problem with Home Page title

text: I am using WordPress and "All in one SEO pack" plugin. I set up the title, descriptions, and keywords, and everything is working nice on site. Then I accidentally looked for my site on Google. I enter my domain in search and when I found my site, I was surprised that my title is not the same as on my site. It's a totally different title, but the description is good. I try some changes but it's not showing in that moment when I change. I don't know what the problem can be. Can someone tell me why is this happening?


title: Sort plugins by rating

text: When I want to install a new Wordpress plugin, I do a search for the plugin I want, and I receive a list of results. Is there any way to sort the results by rating, or name? If not, it would be a useful addition to Wordpress.


title: How to reduce the number of pages in pagination

text: The code below is the function for pagination in my wordpress blog. Presently it outputs 7 pages and then the .. last page number. How can I reduce this number so it shows only 5 pages and then ... last page number?               function emm_paginate_loop($start, $max, $page = 0) {         $output = "";         for ($i = $start; $i <= $max; $i++) {             $output .= ($page === intval($i))                  ? "$i"                  : "$i";         }         return $output;     }


title: Use the page slug in a WP_Query?

text: I'm doing some custom loops that I initialize with a query like this               $the_query = new WP_Query('page_id=266');      It works fine. It's just I'ld to call my page with its slug and not its ID. Would it be possible ?


title: Avoid WP_Query's duplicate posts with taxonomies

text: Given a blog featuring several categories (such as "Sport", "Nature", etc), I've then proceded to create a custom taxonomy, which allows me to show articles in certain areas of my blog with terms such as "slideshow", "sidebar- highlight", "top-category", etc. Inside my sidebar, I've created an area where articles (from the same category, lets say "Nature") are shown using two different loops. The first one shows only one article (the first one in chronological order, from the nature category and which is also inside the "sidebar-highlight" taxonomy's term) with a featured image, title and excerpt, whilst the second, only shows the latest 3 articles from the Nature category. In order to avoid duplicates, I've been using the following code: ` $nature_loop_1 = new WP_Query( array (                   'category_name' => 'nature',          'tax_query' => array (             array (                 'taxonomy'  => 'highlight',                 'field'     => 'slug',                  'terms'     => 'sidebar-highlight',                 'operator'  => 'IN'              )          ),         )       );     $nature_loop_2 = new WP_Query( array (               'category_name' => 'nature',          'tax_query' => array (             array (                 'taxonomy'  => 'highlight',                 'field'     => 'slug',                  'terms'     => 'sidebar-highlight',                 'operator'  => 'NOT IN'              )          ),         )       );       ` Yet, while this works, this means articles from "sidebar-highlight" will never show inside the second loop, no matter when they were posted. So I was wondering if is there any way I could manage to avoiding duplicates while allowing articles from "sidebar-highlight" term show. Thanks in advance.


title: How does adding custom meta to signup form work?

text: Following along with the answer posted here, How to add Custom Blog Options to new blog setup form? I am attempting to understand why the custom meta is added to the options table for the blog as long as I do not let the update_blog_option() run. I added echos and an exit() before that function to be sure the values were correct, and it populated the correct value in the options table. But when I remove the exit() and let it run through, it does NOT populate. The code in question is,               add_action('wpmu_new_blog', 'process_extra_field_on_blog_signup', 10, 6);     function process_extra_field_on_blog_signup($blog_id, $user_id, $domain, $path, $site_id,     $meta) {     update_blog_option($blog_id, 'extra_field', $meta['extra_field']);     }      Additionally, what exactly does the table wp_signups do? Is it a temporary holding location for signups until activated? And does that data get passed to the blog once activated? In which case, the meta that is stored there would get passed anyway right? The code used to add the custom meta is,               add_filter('add_signup_meta', 'append_extra_field_as_meta');     function append_extra_field_as_meta($meta) {     if(isset($_REQUEST['extra_field'])) {         $meta['extra_field'] = $_REQUEST['extra_field'];     }     return $meta;     }      And that is getting stored proper in the wp_signups table. Thank you for your help.


title: Delete the original big size image after upload and leave only 3 images crunched by media gallery

text: I need to know is it possible to somehow erase the original image uploaded via Gravity form : post image - post field?! With the situation now I receive 4 images. 1 original (can be whatever user has on his PC - up to 4 MB which clutters the server) and 3 which Wordpress creates according to specifications (thumbnail, medium, large). I would like to have the ability when user uploads the "original big image" to be deleted upon upload and be left with 3 remaining in media gallery?!. It will dramatically improve the storage on my server. Cheers!


title: Suggestion and Voting Plugin for Wordpress

text: I'm looking for a plugin for wordpress 3 that will allow me to setup a suggestion page. I'll post a question or idea at the top, and then users can post thier suggestions in the comments. then other users can vote for the best suggestions, and comments get sorted by the number of votes they get. i'm thinking of something sort of like the way the digg dialogg system would work, where the best 10 questions would get voted up from the bottom and get used in the show. I did some hunting around and couldn't find anything quite like it. If anyone could point me in the right direction that would be great! Thanks,


title: List recent 25 blogs across the network

text:
I need to list recent 25 blogs in the network with their title. How to edit this code ?               $bcount = get_blog_count();            global $wpdb;       $blogs = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->blogs WHERE spam = '0' AND deleted = '0' and archived = '0' and public='1'"));        if(!empty($blogs)){     ?>
<?php     foreach($blogs as $blog){         $details = get_blog_details($blog->blog_id);         if($details != false){             $addr = $details->siteurl;             $name = $details->blogname;             if(!(($blog->blog_id == 1)&&($show_main != 1))){                 ?>                 <li class="menu-item<?php if($counter == get_current_blog_id()){ echo ' current-menu-item';}?>">                     <a href="<?php echo $addr; ?>"><?php echo $name;?>
                 <?php             }         }     }     ?>
<?php     }


title: Sort posts by custom field numeric value using dropdown

text: I've read umpteen answers and questions about things that are very similar to this but I just can't get it to work for my specific situation. I have some posts with a category of "property". In `category.php` I want these posts to appear in ascending date order initially (as per usual). I then want to have a dropdown menu, which gives the option of viewing:   * price high to low   * price low to high   * latest (default). Each post has been assigned a custom field of "property_price" which is a numeric value. I also need pagination to work. Initial goes with this as my `query_posts`:               <?php     if ( have_posts() ) :       $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;       $args = array(          'meta_key' => 'property_price',          'orderby'  => 'meta_value_num',          'order'    => 'ASC',          'paged'    => $paged       );       query_posts( $args );       while ( have_posts() ) :         the_post();      This just renders a list obviously. However, even at this point, I am stuck as WordPress insists on ordering things like this: 1, 10, 100, 2, 3 so not actually in proper order. I thought using `'orderby' => 'meta_value_num'` was supposed to sort this out? If anyone can help I'd be very grateful. Be gentle on me, I'm no expert so fool-proof instructions gladly received. Thanks in advance.


title: WP_Query with custom post type ID

text: This code isn't echoing out anything, even though I'm 100% positive $mixtape_id is set to an integer which corresponds to one of the posts within the 'mixtapes' custom post type               $query = new WP_Query(array(       'post_type'      => 'mixtapes',       'p'              => (int)$mixtape_id,       'posts_per_page' => -1,       'orderby'        => 'meta_value_num',       'meta_key'       => 'track_number'     ));          while ( $query->have_posts() ) : $query->the_post(); ?>          <track>         <location>track1.mp3</location>         <creator>Artist name</creator>         <title>Track 1</title>     </track>          <?php endwhile; ?>


title: toolbar not visible on pages using front-page template

text: My profile is set to show the WP toolbar when viewing the site, but on a page using the front-page.php template the toolbar space is reserved but its contents are not visible. What could be the reason for this?


title: 404 Page when emptying spam or deleting a plugin

text: I have recently had a website migrated by my host over to a new server within the same network. I have now noticed that within the WordPress dashboard, if I try and do any of the following...               Empty Spam     Delete Plugin      I get a 404 error, I imagine it is something to do with the migration but in terms of tackling my hosts can anyone suggest an area to concentrate on for fixing it?


title: Editing a list of several fields

text: I need to edit a list of quotes. Every quote consists of a (short) text, author's name, author's title. What is the best way to create an editor of such data in WordPress? It seems that the simplest solution is to create a custom post type. Should the quote text become the title of a post? (It is not quite the title, logically.) If not with post types, then how? Note, that I need two lists of quotes (in two languages).


title: Facebook sharer and parameters in URL

text: So after a lot of troubles (and thanks to this answer) I managed to make a GET parameter look better in URL, from `www.url.com/mypage/?id=123` to `www.url.com/mypage/123/` I hoped that would solve the redirection problem with Facebook sharer, but it doesn't. Facebook still recognizes my shared url as `www.url.com/mypage/` How is it even possible? Studying some Wordpress rewrite rules, I learned that when I type (link1) `www.url.com/nameofpage/` in fact I get redirected to (link2) `www.url.com/?pagename=nameofpage`. So why when I share link1 it recognizes it without redirecting to link2? How can I share the link I want (with id parameter) and make it work without redirections? * * * Edit: my code to rewrite the URL               add_action( 'init', 'miareg' );     function miareg(){         add_rewrite_tag("%id%", '(\d+)');         add_rewrite_rule('^flipbook/([^/]*)/?','index.php?page_id=6031&id=$matches[1]','top');     }      The real name of the page I have to share is /flipbook/ and the parameter is "id"; for example I have to share `www.mywebsite.com/flipbook/?id=82`. To explain `page_id=6031` : it's of course the id of the page (has nothing to do with the id mentioned before - the parameter)


title: Exclude one category from get_the_term_list

text: I want to exclude one of the categories from my posts, which will always be the same, named "documentaires" and with the ID 20. Here is the code :               <?php echo get_the_term_list( get_the_ID(), 'project_category', '', ', ' ); ?>


title: register_settings callback function posing problem

text:
Hi I am writing this plugin as an exercise and everything is working except when I try to validate image upload through register_setting callback function it doesn't save data to options.php at all. Here is the code. I will highlight the problematic area. This is the line where I am having problem.               register_setting('JW_options_page',  'JW_options_page',array($this,  'jw_validate_setting'));      If I remove array($this, 'jw_validate_setting')); everything works except that I can't upload image.               <?php     /*         Plugin Name: Theme Admin Panel         Plugin URI: http://www.orangecreative.net         Description: Add extra functionality to restricted users.         Author: S. Abdullah         Version: 1.0         Author URI: http://www.orangecreative.net      */          class JW_options{         public $options;         public function __construct(){             $this->options = get_option('JW_options_page');             $this->register_settings_and_fields();         }              public function admin_menu_page(){             add_options_page('Theme Options', 'Theme Options', 'administrator', __FILE__, array('JW_options', 'display_options_page'));         }              public function display_options_page(){             ?>

My Theme options
                 <?php var_dump(get_option('JW_options_page')); ?>                 <form action="options.php" method="post" enctype="multipart/form-data">                     <?php settings_fields('JW_options_page'); ?>                     <?php do_settings_sections(__FILE__); ?>
                         <input type="submit" value="Save Changes" class="button-primary"/>
                      </form>
         <?php         }              public  function register_settings_and_fields(){             register_setting('JW_options_page', 'JW_options_page',array($this, 'jw_validate_setting'));             add_settings_section('jw_main_section', 'Main Settings', array($this, 'jw_main_section_cb'), __FILE__);             add_settings_field('jw_banner_heading', 'Banner Heading :', array($this, 'jw_banner_heading_settings'), __FILE__, 'jw_main_section');             add_settings_field('jw_logo', 'Your Logo :', array($this, 'jw_logo_setting'), __FILE__, 'jw_main_section');             add_settings_field('jw_color_scheme', 'Your Desired Color :', array($this, 'jw_color_scheme_setting'), __FILE__, 'jw_main_section');              }                        public  function jw_validate_setting($plugin_options){                 echo('ccsjdncjncdjcndjcndjcncjdncjdcndj');     //        if(!empty($_FILES['jw_logo_upload']['temp_name'])){     //            $override = array('test_form' => false);     //            $file = wp_handle_upload($_FILES['jw_logo_upload'], $override);     //            print_r($file);     //     //        }         }         public function jw_main_section_cb(){             //optional         }              public function jw_banner_heading_settings(){             echo "<input name='JW_options_page[jw_banner_heading]' type='text' value='{$this->options['jw_banner_heading']}'/>" ;              }         public function jw_logo_setting(){             echo "<input type='file' name='JW_options_page[jw_logo_upload]'/>" ;         }         public function jw_color_scheme_setting(){             $items = array('Red','Blue','Black');             echo '<select name="JW_options_page[jw_options_page]">';             foreach($items as $item){                 echo "<option value='$item'>$item</option>";             }             echo '</select>';         }          }     if(is_admin()){     add_action('admin_menu',function(){         JW_options::admin_menu_page();          });     add_action('admin_init', function(){         new JW_options();     });     }


title: Custom post type filter is being applied to all of my posts

text: I've created a filter to alter `the_title` hook in one of my custom post types (thanks Chip Bennett for the snippet). The function is supposed to tell Wordpress to call the title from a custom field (`_location`) within my custom post type page. The problem is that all of my pages and posts in Wordpress are displaying 'No Title'. Instead, I want plain 'ole posts to display their titles normally, then I want my custom post title to display the contents from my custom field. Here's the code that filters the titles:               function change_title ( $title ) {      if ( !'events' == get_post_type() ) {          return $title;      } else {          global $post;          $custom = ( get_post_custom( $post->ID ) ? get_post_custom( $post->ID ) : false );          $custom_title = ( isset( $custom['_location'][0] ) ? $custom['_location'][0] : '(No Title)' );          return $custom_title;      }           }      add_filter( 'the_title', 'change_title' );       Here's my entire functions.php file:               <?php               // Registers the new post type and taxonomy     function wpt_event_posttype() {     register_post_type( 'events',         array(             'labels' => array(                 'name' => __( 'Custom Widgets' ),                 'singular_name' => __( 'Custom Widget' ),                 'add_new' => __( 'Add Custom Widget' ),                 'add_new_item' => __( 'Add New Custom Widget' ),                 'edit_item' => __( 'Edit Custom Widgets' ),                 'new_item' => __( 'Add New Custom Widgets' ),                 'view_item' => __( 'View Custom Widgets' ),                 'search_items' => __( 'Search Custom Widgets' ),                 'not_found' => __( 'No custom widgets found' ),                 'not_found_in_trash' => __( 'No custom widgets found in trash' )             ),             'public' => true,             'supports' => array( 'custom_fields' ),             'capability_type' => 'post',             'rewrite' => array("slug" => "events"), // Permalinks format             'menu_position' => 99,             'register_meta_box_cb' => 'add_events_metaboxes'         )     );     }     add_action( 'init', 'wpt_event_posttype' );                    // Add the Custom Widgets Title Meta Box     function add_events_metaboxes() {     add_meta_box('wpt_events_location', 'Custom Widget Title', 'wpt_events_location', 'events', 'normal', 'high');          // Add the Page Template Assignments Meta Box     add_meta_box('pagetemplate', 'Page Template Assignments', 'pagetemplate', 'events', 'normal', 'high');          // Add the Post Assignments Meta Box     add_meta_box('postassignments', 'Post Assignments', 'postassignments', 'events', 'normal', 'high');          // Add the Additional Filters Meta Box     add_meta_box('additionalfilters', 'Additional Filters', 'additionalfilters', 'events', 'normal', 'high');     }               // The Callback for Custom Widget Title Metabox     function wpt_events_location() {     global $post;     // Noncename needed to verify where the data originated     echo '<input type="hidden" name="eventmeta_noncename" id="eventmeta_noncename" value="' .     wp_create_nonce( plugin_basename(__FILE__) ) . '" />';     // Get the title data if its already been entered     $boxtitle = get_post_meta($post->ID, '_location', true);     // Echo out the field     echo '<input type="text" name="_location" value="' . $boxtitle  . '" class="widefat" />';     }               // The Callback for Page Template Assignmets Metabox     function pagetemplate() {     global $post;     // Noncename needed to verify where the data originated     echo '<input type="hidden" name="pagetemplatemeta_noncename" id="pagetemplate_noncename" value="' .     wp_create_nonce( plugin_basename(__FILE__) ) . '" />';     // Get the title data if its already been entered     $boxtitle2 = get_post_meta($post->ID, 'page_template', true);     // Echo out the field     echo '<input type="text" name="page_template" value="' . $boxtitle2  . '" class="widefat" />';     }               // The Callback for Post Assignmets Metabox     function postassignments() {     global $post;     // Noncename needed to verify where the data originated     echo '<input type="hidden" name="postassignmentsmeta_noncename" id="postassignments_noncename" value="' .     wp_create_nonce( plugin_basename(__FILE__) ) . '" />';     // Get the title data if its already been entered     $boxtitle3 = get_post_meta($post->ID, 'post-assign', true);     // Echo out the field     echo '<input type="text" name="post_assign" value="' . $boxtitle3  . '" class="widefat" />';     }               // The Callback for Additional Filters Metabox     function additionalfilters() {     global $post;     // Noncename needed to verify where the data originated     echo '<input type="hidden" name="additionalfiltersmeta_noncename" id="additionalfilters_noncename" value="' .     wp_create_nonce( plugin_basename(__FILE__) ) . '" />';     // Get the title data if its already been entered     $boxtitle4 = get_post_meta($post->ID, 'additional_filters', true);     // Echo out the field     echo '<input type="text" name="additional_filters" value="' . $boxtitle4  . '" class="widefat" />';      }               // Save the Metabox Data     function wpt_save_events_meta($post_id, $post) {     // verify this came from the our screen and with proper authorization,     // because save_post can be triggered at other times     if ( !wp_verify_nonce( $_POST['eventmeta_noncename'], plugin_basename(__FILE__) )) {     return $post->ID;     }     // Is the user allowed to edit the post or page?     if ( !current_user_can( 'edit_post', $post->ID ))         return $post->ID;     // OK, we're authenticated: we need to find and save the data     // We'll put it into an array to make it easier to loop though.     $events_meta['_location'] = $_POST['_location'];     // Add values of $events_meta as custom fields     foreach ($events_meta as $key => $value) { // Cycle through the $events_meta array!         if( $post->post_type == 'revision' ) return; // Don't store custom data twice         $value = implode(',', (array)$value); // If $value is an array, make it a CSV (unlikely)         if(get_post_meta($post->ID, $key, FALSE)) { // If the custom field already has a value             update_post_meta($post->ID, $key, $value);         } else { // If the custom field doesn't have a value             add_post_meta($post->ID, $key, $value);         }         if(!$value) delete_post_meta($post->ID, $key); // Delete if blank     }     }     add_action('save_post', 'wpt_save_events_meta', 1, 2); // save the custom fields                         add_filter( 'manage_edit-events_columns', 'my_edit_events_columns' ) ;          function my_edit_events_columns( $columns ) {          $columns = array(         'cb' => '<input type="checkbox" />',         'title' => __( 'Custom Widget Title' ),         'page_assign' => __( 'Page Template Assignments' ),         'post_assign' => __( 'Post Assignments' ),         'additional' => __( 'Additional Filters' ),         'date' => __( 'Date' )          );          return $columns;     }                         add_action( 'manage_events_posts_custom_column', 'my_manage_events_columns', 10, 2 );          function my_manage_events_columns( $column, $post_id ) {     global $post;          switch( $column ) {              /* If displaying the 'duration' column. */         case 'page_assign' :                  /* Get the post meta. */             $page_assign = get_post_meta( $post_id, 'page_assign', true );                  /* If no duration is found, output a default message. */             if ( empty( $page_assign ) )                 echo __( 'Unknown' );                  /* If there is a duration, append 'minutes' to the text string. */             else                 printf( __( '%s minutes' ), $page_assign );                  break;              /* If displaying the 'duration' column. */         case 'post_assign' :                  /* Get the post meta. */             $post_assign = get_post_meta( $post_id, 'post_assign', true );                  /* If no duration is found, output a default message. */             if ( empty( $post_assign ) )                 echo __( 'Unknown' );                  /* If there is a duration, append 'minutes' to the text string. */             else                 printf( __( '%s minutes' ), $post_assign );                  break;                               /* If displaying the 'genre' column. */         case 'additional' :                  /* Get the genres for the post. */             $terms = get_the_terms( $post_id, 'additional' );                  /* If terms were found. */             if ( !empty( $terms ) ) {                      $out = array();                      /* Loop through each term, linking to the 'edit posts' page for the specific term. */                 foreach ( $terms as $term ) {                     $out[] = sprintf( '%s',                         esc_url( add_query_arg( array( 'post_type' => $post->post_type, 'additional' => $term->slug ), 'edit.php' ) ),                         esc_html( sanitize_term_field( 'name', $term->name, $term->term_id, 'additional', 'display' ) )                     );                 }                      /* Join the terms, separating them with a comma. */                 echo join( ', ', $out );             }                  /* If no terms were found, output a default message. */             else {                 _e( 'No Additional Filters' );             }                  break;              /* Just break out of the switch statement for everything else. */         default :             break;     }     }               function change_title ( $title ) {       global $post;       if ( !'events' == get_post_type( $post ) ) {           return $title;       } else {           $custom = ( get_post_custom( $post->ID ) ? get_post_custom( $post->ID ) : false );           $custom_title = ( isset( $custom['_location'][0] ) ? $custom['_location'][0] : '(No Title)' );           return $custom_title;       }            }       add_filter( 'the_title', 'change_title' );


title: Why time functions show invalid time zone when using 'c' time format?

text: These are the functions I use in my theme to display the "entry-meta" which includes **published** and **last modified** dates (among others) of an article:               // Shows Author and Published Date     if ( ! function_exists( 'reddle_posted_on' ) ) :     function reddle_posted_on() {         printf( __( 'Posted by %7$s — <time datetime="%3$s" pubdate>%4$s</time>', 'reddle' ),             esc_url( get_permalink() ),             esc_attr( get_the_time() ),             esc_attr( get_the_date( 'c' ) ),             esc_html( get_the_date() ),             esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),             sprintf( esc_attr__( 'View all posts by %s', 'the-wolf' ), get_the_author() ),             esc_html( get_the_author() )         );     }     endif;          // Shows Last Modified Date     if ( ! function_exists( 'reddle_last_modified_on' ) ) :     function reddle_last_modified_on() {         printf( __( 'Last updated on <time class="updated" itemprop="dateModified" datetime="%2$s">%3$s</time>', 'reddle' ),             esc_attr( get_the_modified_time() ),             esc_attr( get_the_modified_date( 'c' ) ),             esc_html( get_the_modified_date( 'F j, Y ~ H:i' ) )         );     }     endif;      Do you see anything wrong with these functions? The problem is, despite setting the time zone of my blog to `GMT-05:00` (-04:00 DST) in **WordPress Dashboard > Settings > General** the timestamp that is output shows `GMT+00:00`. Any idea why?


title: Ordering Pages and Increasing Navigation

text: Is there a way of ordering my pages on my WordPress site so they appear in the navigation bar of the order i choose? ALSO: When i have too many wordpress pages for the navigation, it hides some pages. Is there a way to stop this so all pages are shown?


title: Custom posts and get_post_meta in {$post_status}_{$post_type}

text: I am making a function to parse a .csv file uploaded in a custom field of a custom post. The name of the custom **phone** and the field's name is **plan_information** . The problem is when I `var_dump(get_post_meta($post_id, 'plan_information', TRUE))` , I get an empty string. The code I use is the following:               add_action('publish_phone', 'parse_csv', '99', 2);          function parse_csv($post_id) {          global $post;          $csv_file = get_post_meta($post_id, 'plan_information', TRUE);          $csv_file = wp_get_attachment_url($csv_file);          $title = get_post_meta($post_id, 'manufacturer', TRUE);     $title .= ' '.get_post_meta($post_id, 'model', TRUE);     $title .= ' '.get_post_meta($post_id, 'memory', TRUE);          $url = get_bloginfo('wpurl').'/';          $csv_file = str_replace($url, ABSPATH, $csv_file);          if($csv_file && !$carriers) {         $fp = fopen($csv_file ,"r");         if($fp) {             fgetcsv($fp, 1000, ",");                  while (($data = fgetcsv($fp, 1000, ",")) !== FALSE)             {                      $new_carrier = array(                     'post_title' => $title. ' '. $data[0] . ' ' . $data[3],                     'post_status' => 'publish',                     'post_type' => 'carrier'                     );                 $post_id = wp_insert_post($new_carrier);                 add_post_meta($post_id, 'operator', $data[0], true);                 add_post_meta($post_id, 'logo', $data[1], true);                 add_post_meta($post_id, 'cost', $data[2], true);                 add_post_meta($post_id, 'plan_name', $data[3], true);                 add_post_meta($post_id, 'hero', $data[4], true);                 add_post_meta($post_id, 'summary', $data[5], true);                 add_post_meta($post_id, 'phone_id', $post_id, true);             }         }              fclose($fp);     }          }


title: Activating child theme returns "active theme is broken"

text: I was using the Pinboard theme, but want to make modifications to it. Instead of editing the theme files directly, I wanted to try to make my changes using a child theme. Following the codex, I created a new folder named **pinboard-child** under **/wp-content/themes/**. I created a **style.css** file, added the code below, and threw it in the folder.               /*     Theme Name: Pinboard Child     Theme URI:      Template: pinboard-child     Description: Child theme for the Pinboard theme     Author: One Designs, modified by me     Version: 1.0     Tags:      */          @import url("../pinboard/style.css");          body {        background-color: #FF0000;     }      (I added the body styling just to see if everything worked as expected) I navigated to **/wp-content/themes/pinboard-child/style.css** to verify my file was in the correct location, and everything showed correctly. After I network-enabled the theme, I found the theme sitting in my Appearance menu, although the preview image was gray. I clicked on "activate", and Wordpress came back with the message "The active theme is broken. Reverting to the default theme." and set my site's theme to Twenty Twelve. After scouring the internet, I'm at a complete loss as to what more I can do. Does anyone know 1. what might be causing this issue and/or 2. what I might be able to do to fix it?


title: Store records for a table in wordpress

text: I need to create a page in wordpress that displays a table with 3/4 fields, and let editors add and update the records in this table. I'm a drupal developer and don't have much experience with wordpress. I know that in drupal I would just create a content type 'record' and than create a view to display a list. I can't think of any way to achieve that in wordpress (in a user friendly way. apperenetly my suggestion to have an unpublished post for each record with a tag 'record' isn't acceptable on my employers...) Thank you for your help...


title: Custom css per category and per single post belong in each category

text: the condition is: there's a wordpress site that has 8 categories, and each category has sub- category, and each subcategory has several posts (and still will be updating/counting) :   * Category A - 8 subcat    * Category B - 5 subcat   * Category C - 4 subcat   * Category D - 3 subcat    * Category E - 2 subcat    * Category F - 1 subcat   * Category G - 5 subcat    * Category H - 4 subcat * * * The body_class() function is already exist in header, and I want to make   * Each category has different background image and custom header (ex: instead of Browsing the "xx" Category text- i'll be using custom words/image)   * For each single post page belong to certain category, the style is inherit. (i dont know how to explain that on english - but what I want to achieve is: A single post that belong to **category A** have the same style with **Category A** archive pages. I did add:                   .category-A          { /* css here */ }              .category-B         { /* css here */ }              etc      but for each single page, the styling did not work.. and to tweak single page that belong to category who- I don't know the code. So... there's pretty much the rough description of my problem, though. Please help :(


title: Category menu that filters out empty categories

text: I'm trying to build a menu which can be administered from the menu editor, but gets filtered before being output. More specifically the menu contains Woocommerce product categories, organised into a hierarchy, and I want to exclude empty categories from being output. This will allow administrator to set the hierarchy once and have the menu reflect which products are currently in stock dynamically. After follwoing ENTHUSIAST's comment about a similar thread I have the code below but am not getting the right result. All items are being output               function exclude_empty_cat_menu_items( $items, $menu, $args ) {       // Get a list of product categories that excludes empty categories       $non_empty_categories = get_categories(array('taxonomy' => 'product_cat'));       // Iterate over the menu items       foreach ( $items as $key => $item ) {         $is_empty = true;         // check current item is in the non-empty categories array         foreach ( $non_empty_categories as $key => $cat )           if ($item->title == $cat->name)              $is_empty = false;           // if it is empty remove it from array           if ($is_empty) unset($items[$key]);       }       return $items;     }     add_filter( 'wp_get_nav_menu_items', 'exclude_empty_cat_menu_items', null, 3 );


title: wp_localize_script() dont parse values

text: I try to parse php values to js file using wp_localize_script()               wp_enqueue_script( 'countdown_js', plugin_dir_path( __FILE__ ) . 'js/countdown.js', array(), '1.0.0', true );              $dataToBePassed = array(         'seconds'            => 10,         'minutes'            => '20'         );     wp_localize_script( 'countdown_js', 'parse_vars', $datatoBePassed );      I get NULL for the values:               <script type="text/javascript">      /* <![CDATA[ */      var parse_vars = null;      /* ]]> */     </script>


title: How to use add_action inside files included by theme's functions.php

text: I've a functions.php inside my theme folder. The first line of `functions.php` is               require_once 'custom.php';      inside `custom.php` I have this simple code:               add_action('wp_print_scripts','add_js_vars');     function add_js_vars(){          //some stuff here     }      The problem with the code above is that add_js_vars is not executed. If I move `add_action('wp_print_scripts','add_js_vars');` inside themes `functions.php` everything works fine. I'm not able to understand what's the problem. Any ideas? Thanks for your help.


title: Save both current and new version of post meta

text: I want to save two versions of my custom meta box data called "sidebar". I want to compare a new and old version of this data later on, so that is why I want to save a copy of the current "sidebar" to a field called "sidebar_old", just before saving a new version. Here's my attempt at doing just that:               add_action('pre_post_update', 'content_old_save');          function content_old_save() {         global $post;         $sidebar_old = get_post_meta($post->ID, 'sidebar', true);              update_post_meta($post->ID, "sidebar_old", $sidebar_old); // current/old sidebar     }      This is how I save the new version:               add_action('save_post', 'sidebar_title_update');          function sidebar_title_update($post_id) {         global $post;              if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) {         return $post_id;         }              update_post_meta($post->ID, "sidebar", $_POST["sidebar"]); // new sidebar     }      Thing is, only the new sidebar value is inserted into the database, to both "sidebar" and "sidebar_old", so somehow the new value is already inserted into the db even before pre_post_update?