title: get_pages - Display child then grandchild pages

text:
I have a page structure like this.                   Portfolio         - Residential         - - Resident 1         - - Resident 2         - - Resident 3         - Commercial         - - Commercial 1         - - Commercial 2         - - Commercial 3      The grandchild pages Resident 1 - Commercial 3 have post thumbnails I have a template for the Portfolio page where i would like to display the 'Residential' and 'Commerical' pages with their child pages like so.

Residential

  Resident 1 post_thumbnail

  Resident 2 post_thumbnail

  Resident 3 post_thumbnail

Commercial

  Commercial 1 post_thumbnail

  Commercial 2 post_thumbnail

  Commercial 3 post_thumbnail

      I'm using get_pages and I have the div's created for 'Residential' and 'Commercial'                   <?php                  $portfolio_sections = array(                 'post_type'     => 'page',                 'child_of'      => $post->ID,                 'sort_column' => 'menu_order',                 'sort_order'    => 'ASC',                 'parent'            => $post->ID             );                  $sections = get_pages($portfolio_sections);                  foreach($sections as $section){                  ?>

<?php echo $section->post_title; ?>
                        //Create Child pages
                  <?php                }         ?>      My problem is creating the child pages in the 'ul' list I tried using a second foreach loop but this didn't work and I don't know if this is the correct way                   <?php                  $portfolio_sections = array(                 'post_type'     => 'page',                 'child_of'      => $post->ID,                 'sort_column' => 'menu_order',                 'sort_order'    => 'ASC',                 'parent'            => $post->ID             );                  $sections = get_pages($portfolio_sections);                  foreach($sections as $section){                  ?>

<?php echo $section->post_title; ?>

                     <?php                         $portfolio_pages = array(                             'post_type'     => 'page',                             'child_of'      => $section->ID,                             'sort_column' => 'menu_order',                             'sort_order'    => 'ASC',                             'parent'            => $section->ID                         );                              $pages = get_pages($portfolio_pages);                              foreach($pages as $page){                             ?>
<a href="<?php echo get_the_permalink($page->ID);?>"><?php echo get_the_post_thumbnail($page->ID, "thumbnail"); ?><?php echo get_the_title($page->ID);?>
                             <?php                         }                     ?>

                  <?php                }         ?>      --- UPDATE ---- The structure I wanted. A div around each ul list

Residential

  Resident 1 post_thumbnail

  Resident 2 post_thumbnail

  Resident 3 post_thumbnail

Commercial

  Commercial 1 post_thumbnail

  Commercial 2 post_thumbnail

  Commercial 3 post_thumbnail

      The structure from the code is one surrounding div.

Residential

  Resident 1 post_thumbnail

  Resident 2 post_thumbnail

  Resident 3 post_thumbnail

Commercial

  Commercial 1 post_thumbnail

  Commercial 2 post_thumbnail

  Commercial 3 post_thumbnail


title: Knowing blog name using blog id

text: I would like to get the blog name using the given blog_id, how would I do this? I tried to search for the codex but cannot find the right information


title: Archive page display all posts which are listed under multiple categories or tags

text: Say I have some posts that I want to display which are listed under the categories "Video Games" and "Reviews". Or I have some posts under the tags "Mario" and Four-Stars". I initially came to ask a question on how to create an archive page that contains posts that are in more than one category but while researching, I figured this out: I can use any of the following links to display posts which only fall into the two categories or tags below:               example.com/category/Video-Games+Reviews/     example.com/tag/Mario+Four-Stars/     example.com/?tag=Mario+Four-Stars      However, on the example pages above, wordpress outputs at the top of the page: "You are here: Home / Archives for Mario", additionally, the title tag of the page reads "Mario Archives - example.com". There is no mention of the tag "Four-Stars" anywhere on the page. Same goes for the category example, it mentions the category listed first, "Video Games", but does not mention "Reviews". I did find a forum where a 'solution' to this problem was offered but it did nothing for the output on my site. I included the following in Functions.php               function my_get_the_tag_query() {     $nice_tag_query = $_SERVER['REQUEST_URI'];     $nice_tag_query = str_replace('/tag/','', $nice_tag_query);     $nice_tag_query = str_replace(',', ', ', $nice_tag_query);     $nice_tag_query = str_replace('/','', $nice_tag_query);     return $nice_tag_query;     }      And I included this in the header.php               is_tag( $nice_tag_query );      and also tried               is_tag();      As I said above, this code did not make it so both tag names appeared on the page. Is there something I am doing wrong? Also I tried adding the following code to my functions.php page https://gist.github.com/certainlyakey/7dd680dbb1235e1560c9 Same thing, this did not work for me either. Please any suggestions would be helpful. I am using a StudioPress created, Genesis Child Theme.


title: wordpress simple post multi rating with post_meta and user_meta

text: I am trying to create a multi criteria post rating function with simple form and post_meta and user meta. ## The Goal when users submits their ratings 2 things should happen: 1.the ratings is stored in the post_meta called 'wpd_rating' like this:               array(user id => array(               field1 => 5               field2 => 3               field3 => 4               ),           another user id => array(               field1 => 2               field2 => 5               field3 => 4               )          )       2.the ratings is stored in the user_meta called 'plgn_rating' like this:               array(post id => array(               field1 => 5               field2 => 3               field3 => 4               ),           another rated post id => array(               field1 => 2               field2 => 5               field3 => 4               )          )       ## The Code (Not working Obviously) **In single.php:** the header part:               <?php // top of page     if ( isset( $_POST['drw_inventory'] ) && wp_verify_nonce($_POST['drw_inventory'],'update_drw_postmeta') )         { //if nonce check succeeds.             global $post;             $postid = $post->ID;             $data = $_POST['wpd_function_rating'];             $data2 = $_POST['wpd_feature_rating'];             $data3 = $_POST['wpd_support_rating'];             $currentusr = get_current_user_id();                  //*******************The post meta field Part****************************             //Get the Existing user ratings of this post             $ls_up_votes = get_post_meta($postid, 'wpd_rating');                  //if the current user already rated, unset the rating             foreach ( $ls_up_votes as $key => $value )               {                 if ( $key == $currentusr )                   {                     unset( $ls_up_votes[$key] );                   }               }              //Add post meta 'wpd_rating' with this structure:          //array(userid => array('wpd_function_rating' => '3','wpd_feature_rating' => '5','wpd_support_rating' => '4',))             $up_vote = array($currentusr => array('wpd_function_rating' => $data,'wpd_feature_rating' => $data2,'wpd_support_rating' => $data3));                  //appending new user ratings after one another             $ls_up_voted = array_merge($ls_up_votes, $up_vote);             update_post_meta($postid,'wpd_rating',$ls_up_voted);                            //*******************The user field Part****************************             //Get the Current user ratings of this post             $user_rated_posts = get_user_meta($currentusr, 'plgn_rating',true);             foreach ( $user_rated_posts as $key => $value )               {                 if ( $key == $postid )                   {                     unset( $user_rated_posts[$key] );                   }               }             //add a user field 'plgn_rating' with this structure             //(postid => array('wpd_function_rating' => '3','wpd_feature_rating' => '5','wpd_support_rating' => '4',))             $usr_vote = array($postid => array('wpd_function_rating' => $data,'wpd_feature_rating' => $data2,'wpd_support_rating' => $data3));             //appending new user ratings after one another             $ls_up_voted = array_merge($user_rated_posts, $usr_vote);             update_user_meta($currentusr,'plgn_rating',$ls_up_voted);              }          ?>      The Form:               <form method="post" action="">        <?php wp_nonce_field('update_drw_postmeta','drw_inventory'); ?>        <label>This is label</label>        <input type='text' name='wpd_function_rating' value='' />        <input type='text' name='wpd_feature_rating' value='' />        <input type='text' name='wpd_support_rating' value='' />        <input type='submit' value='save' />     </form>      **Issues with the current code**   1. The array is not saving as I structured. I am pretty sure I am using the array_merge wrong. or the calling the get_post_meta wrong.   2. The code is not checking for the existing user rating and replacing the old ratings with the new one. ## Update as s_ha_dum suggested tried this with no avail:               foreach ( $ls_up_votes as $key => $value ){      var_dump($key,$value);             if ( $key == $currentusr ){            unset( $ls_up_votes[$key] );        }     }       When I add the user input 2 times, the unset commands should remove the previous array that was added by the same user and add the new one, instead its adding all 2 times.Here is what I am getting:               Array ( [0] => Array ( [0] => [1] => Array ( [wpd_function_rating] => 33 [wpd_feature_rating] => 23 [wpd_support_rating] => 66 ) ) [1] => Array ( [wpd_function_rating] => 44 [wpd_feature_rating] => 11 [wpd_support_rating] => 32 ) )


title: How to get only 1 role from user

text: I have this code that will display all the roles for that particular user, but I only need to display 1 role from the user. I have installed bbpress so the code below will display out 2 roles.               $user = new WP_User( 1 );          if ( !empty( $user->roles ) && is_array( $user->roles ) ) {     foreach ( $user->roles as $role )     echo $role;                      }      Result: Administrator Participant How to display only the first role?


title: Creating a Digital Download facility and track downloads

text: I need to make available Documents for download and I need to track the document name/number of downloads for each user and list of downloaders for each download, is this possible with WordPress, if so any suggestions ? Praveen


title: How to overwrite orderby with add_query_var

text:
So I would like to have an archive that displays its posts in a random order.               <?php             $query = new WP_Query($query_string."&orderby=rand");     ?>      But also then if the user chooses they can order the posts differently by clicking a button.               <?php         $sort_date = add_query_arg(array('orderby'=>'date','order'=>'asc'));         $sort_name = add_query_arg(array('orderby'=>'title','order'=>'asc'));     ?>
         Sort by: <a href="<?php echo $sort_date; ?>">Date Listed | <a href="<?php echo  $sort_name; ?>">Name
      These 2 things work separately but when I try and use them together the archive just keeps display the posts randomly. How can I get these 2 to work together?


title: Link to previous month's posts

text: On my homepage I am showing only the current month's posts. I'd like to include a link to the previous month's posts at the bottom of the page. Wordpress has `get_month_link` (http://codex.wordpress.org/Function_Reference/get_month_link). I can use this function like so to get the month number, minus 1 = previous month:               $archive_year  = get_the_time('Y');      $archive_month = get_the_time('m');     $previous_month = $archive_month - 1          <a href="<?php echo get_month_link( $archive_year, $previous_month ); ?>">Last month's posts      This will output a link like "/?m=201308" if the month is September. In most cases this will work, but when I get to January, the `$previous_month` var will be "01 - 1", and won't give me "12" for December's posts. Any ideas how to make this a little more fail-safe for situations like December? Many thanks


title: Populate a slideshow list of images from images in a wordpress page?

text:
I'm using the "flexise" slideshow script to automatically scroll a list of images. The list is hard-coded along with the script in a wordpress template page. While this works fine, how could you make it so that the slideshow pulled any images added to a special (private) wordpress page instead of having to add each img src manually??

        Many thanks Trying your suggestion now, I've replaced the above with this:               $attachments = get_posts(array(     'post_type' => 'attachment',     'numberposts' => -1,     'post_status' =>'any',     // This is where you specify the ID of your private image page     'post_parent' => 6909,     ));          if (count($attachments)) {     // We have attachments     ?>
         <?php         // Now we loop through them         foreach ($attachments as $attachment) {             ?>
                 <?php echo wp_get_attachment_image($attachment->ID, 'full'); ?>
             <?php         }         ?>
     <?php     }       But it's throwing an error. Probably something simple, but I'm not experienced enough to debug?               Parse error: syntax error, unexpected '<' in /home4/speedyp/public_html  /speedypancake.com/tmc/wp-content/themes/sirens/page_f.php


title: user_login vs. user_nicename

text: When you call the `get_users()` functions, a list of user objects are returned. Each of those users has a number of properties. What is the difference between `user_login` and `user_nicename` in those returned properties for each user? And which of those two properties are displayed in the URL? (I am asking because both properties are the same in my case!).


title: How to programatically create a simple HTML page using the permalink of a Wordpress post?

text: I want a create a simple HTML page (not Wordpress Page) programmatically by using the permalink structure of another already existing post. E.g. Already existing post is `www.example.com/this-is-example-post` I want to create 3 more pages viz.               www.example.com/this-is-example-post/index1     www.example.com/this-is-example-postindex2     www.example.com/this-is-example-post/index3      These URLs need not be real pages. I just need three different pages to store different Facebook meta. I'm building a plugin. Please guide. How can I achieve it? Am I thinking twisted? I'm going crazy thinking about it. :( Please help. **-------------EDIT---------------** After working on suggestions from Rahil, here's where I'm now               <?php      add_action( 'init', 'xx_add_endpoint' );          function xx_add_endpoint()     {         add_rewrite_endpoint( 'index', EP_PERMALINK );     }          add_action( 'template_redirect', 'xx_render_endpoint' );          function xx_render_endpoint()     {         if ( ! is_singular() or ! get_query_var( 'index' ) )         {             return;         }              // Do somthing here         exit;     }               add_filter( 'request', 'xx_set_endpoint_var' );          function xx_set_endpoint_var( $vars )     {         isset( $vars['index'] ) and $vars['index'] = true;         return $vars;     }          ?>      But I'm trying to understand how I can pass variables to this request e.g. `www.example.com/this-is-example-post/index/20/1`, `www.example.com/this-is- example-post/index/20/2`, `www.example.com/this-is-example-post/index/20/3` and so on. p.s. I intend to pass two values viz. `/index/a/b` where `a`,`b` are the two values to be sent and handled under `xx_render_endpoint` function. Please guide.


title: Wordpress site interfering with another site on same server (Surftown)

text: I have a server at surftown.com, and on that I have 3 WP sites. The main/root folder, where you usually put your index file and so on, does not contain anything, other than 3 different folders called 1, 2 and 3. In these folders I have 3 different WP sites. Now, the first WP site (1) is setup with Duplicator in WP, which makes it a duplicate of another WP site I have. The two others are made from the OneClick Toolbox in surftown admin menu, where it just creates a WP site for you, and then you can install whatever you need. So here comes the problem: The first WP site (1) doesn't have any problems at all. But, the other two to interfere with each other. Sometimes when I try to login at site 3, it doesn't recognize the user/pass at all, and if I finally get it, it's like I'm on the site 2. Besides that, when I visit the site 3, and click on a menu link or something, it takes me to the site 2 instead (They have the same link names, since I'm just making different designs to show). And then, sometimes it works, but most often not. I have no idea why this is happening. The databases are not called the same thing. I do use the same user/pass on both sites, but as I said, it doesn't interfere with the site 1. So am I doing something wrong. Maybe it's not optimal to have more WP sites on the same server ? Thanks in advance.


title: how to limit edit_form_after_title hook to page and post edit only?

text: heelo, I want to use this great hook **edit_form_after_title** it was announced on December 1, 2012:   http://make.wordpress.org/core/2012/12/01/more-hooks-on-the-edit-screen/ **it curreclty hook for : post-new, post, page-new, page.** how do I make it to work only in edit page/post ( **only post, page** ) thanks all


title: wp_localize_script problem for shortcode

text: I have developed a shortcode with wp_localize_script like the below code `               wp_enqueue_script( 'twi_carousel_tooltip_main_option_js', plugins_url( '/js/main_tooltip.js' , **FILE** ) , array( 'jquery') , false, true);     wp_localize_script( 'twi_carousel_tooltip_main_option_js', 'tooltip_setting', array(                     'twi_tooltip_the' => $twi_tooltip_themes,                          'ulidli' => '.'.$ulid.' '.'.'.$id_s                      )                 );                     ` and run these value with jquery each loop like that               jQuery(document).ready(function($){     var ulidli = tooltip_setting.ulidli;                               $(ulidli).each(function() {                      var theme = tooltip_setting.twi_tooltip_the;                      jQuery(this).tooltipster({                          theme:theme                      });                  });              });      I got CDATA like that                    var tooltip_setting = {"twi_tooltip_the":"tooltipster-punk","ulidli":".twi_carousel_97 .twi_carousel_tooltip"};     var tooltip_setting = {"twi_tooltip_the":"tooltipster-light","ulidli":".twi_carousel_1 .twi_carousel_tooltip"};           But did not work both of them 2nd one is working but another is not. Can you please tell me which is best way to work with wp_localize_script with multi shortcode ??? Thanks


title: Posts not listing out sub category in hierarchy

text: I have a magazine like post structure like so: `Parent -> Sub category -> Article`. The parent is the issue, the sub categories are the sections within the magazine like news and interviews etc and then the articles are within those sections. I have background images which are associated with the sub category and then articles within that sub category inherit the background image. Code in single.php which retrieves the background image from its sub category hence [1] not its top level parent [0].               <?php      $category = get_the_category();     $hierarchy = array_reverse( get_ancestors( $category[0]->term_id, 'category' ) );     $hierarchy[] = $category[0]->term_id;      ?>          <body style="background:url('<?php echo z_taxonomy_image_url($hierarchy[1]); ?>')" class="background-img">      For the most part this works just fine, however on a few articles the background image doesn't show. I have breadcrumbs showing the category structure and the posts that work show the full `parent -> sub category -> post name` structure, however on the ones that don't work just shows `parent -> post name.` There is the standard wordpress breadcrumbs and meta info at the bottom which always displays the correct heirachy for the post which is why I am confused. How come some posts how their correct heirachy whilst others don't? My permalink structure is `index.php/category/postname` You can check the bug out here post with background and proper taxonomy at the top post with incorrect hierarchy here so no background and incorrect breadcrumbs at the top


title: Adding pub_Date to an RSS feed hosted on Wordpress

text: I am trying to use the FaceBook application RSS Grafitti to link my RSS feed from my Wordpress installation to a FaceBook Fanpage. It finds the feed OK, but cannot post to the Fan page because there is apparently no pubDate field in the RSS feed. I am not even sure where to find the file to edit in my WordPress installation. I have WordPress 3.0.1 installed on a shared Linux host.


title: Post images deseappeared from homepage after run query for delete related images

text: I run a wp blog that shows lasts posts in its homepage, but after run a query to delete the related images from all posts my images disappeared from the homepage, but it is still appearing in categories and single pages. Does anyone have an idea in how to make it shows the images again? btw: the images showed in home weren't related images, because it used to show the images before even without a related image set. Page: http://www.vidaloka.net Thanks a lot.


title: Default Display Name As Username

text: I don't know why it's so hard to find a solution for this but nothing seems to work when i finally find an answer.. I want to simply make the default display name as the users login/username.. I know I can edit each user, but I want it to be set like that for everyone and everyone that registers in the future. Any ideas? Thanks


title: Custom query_vars and parse_request on wp-admin

text: I've read this post http://wordpress.org/support/topic/query-vars-in-admin and although it's quite an old question, it suits me perfectly. I'm trying to accomplish what I already posted here: Rewrite rule for admin-ajax.php But in the code below, only the first filter gets called while in wp-admin:               add_action('init', array('MYCLASS', 'add_custom_rewrite_rules'), 10, 1);     add_action('query_vars', array('MYCLASS', 'add_custom_query_vars'), 10, 1);     add_action('parse_request', array('MYCLASS', 'add_custom_parse_request'), 10, 1);      I can't get this to work. It seems the two last filters are not called while navigating inside wp-admin. Is that true? How can I get around this?


title: How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?

text: I just encountered a problem and realized that all tags must be globally unique. Here is what just happened to me: I created a taxonomy called `writer` and added each author and collaborator to the post they have written or/and collaborated to. For this, I was getting `post id as the $object_id` and `user nicename as the $term` for the `wp_set_object_terms` function. After filling up my new taxonomy with the writters, I wanted to display a list of posts using WP_Query and tax_query. The arguments for the tax_query would be as follows:               'tax_query' => array(         array(             'taxonomy' => 'writer',             'field' => 'slug',             'terms' => $array_of_nicenames         )     )      So each item in the array would be matched against the taxonomy slug. Everything was working fine until I hit and already created slug. Thus, the writer slug would read `user_nicename-2` instead of `user_nicename`. The post made by this user would not be displayed on my list. I hope I am making myself clear; otherwise, ask me to clearify anything. I was thinking about using the user id instead of the user nicename; however, eventually I would come up with the same problem. For example, I could have a tag called 2003 and a user with the same id. A _possible solution_ I came up with but I would like to avoid is this one: For each new user, create a meta tag that would include the user nicename attached to a preffix like this `uniquepreffix-user_nicename`, thus incrementing my chances to have a really unique username/slug for later use. Is there any other way I can accomplish what I want without encountering this problem? Can I use tax_query by name instead of slug?


title: Advanced Custom Fields - Check if multiple get_fields exist?

text:
I can only really seem to find documentation on wether one get_field exists or not. Is it possible to put multiple get_field's into one variable and use that variable to check if any of the singular get_field variables exist? So for example I have these variables below, and then put them all into one: `$promotions`               <?php               $rider_plan_code        = get_field('rider_plan_code');         $low_rate_finance_code  = get_field('low_rate_finance_code');         $custom_promo_code      = get_field('custom_promo_code');              $promotions = isset( $rider_plan_code, $low_rate_finance_code, $custom_promo_code );          ?>         Then I am using this... `<?php if ($promotions) { ?>` to check if any of those variables exist, but its not working. Can anyone point out what I'm doing wrong? Many Thanks * * * See below how I am using this...
               Post to wall              <a class="btn <?php if ($promotions) { echo 'dropdown-toggle'; } ?> pricing-btn" href="#" title="Pricing" <?php if ($promotions) { echo 'data-toggle="dropdown"'; } ?>>             £<?php the_field('rrp-pound-sterling'); ?><?php if ($promotions) { echo ' '; } ?>                       <?php if ($promotions) { ?>
                 <?php if ($rider_plan_code) { ?>
Rider Plan
<?php } ?>                 <?php if ($low_rate_finance_code) { ?>
Low Rate Finance
<?php } ?>                 <?php if ($custom_promo_code) { ?>
<?php echo $custom_promo_name; ?>
<?php } ?>
              <?php } ?>


title: Get custom field value from not-current page

text: What is the best way of getting a custom field value from a page which is not the one currently displayed? I know the title of the page i want to get custom field value from, but not the pageID. Thanks!


title: Why does WP recommend against custom favicon functionality in themes?

text: I am developing a WordPress theme, and when reading the Codex article on Theme review, WP recommendeds against allowing custom favicons in a theme. Does anyone know the reason for this recommendation? From the Codex: > Favicons   >  Themes are recommended not to implement custom favicon functionality.   >  If implemented, favicon functionality is required to be opt-in, and > disabled by default.   >  If implemented, favicon functionality is required to support user-defined > favicon images


title: Compare two numeric custom fields

text: I use Advanced Custom Fields and have a custompost-type "matches". This post- type contains two fields "goals-made" and "goals-against". I want to query wordpress to show only the matches that were won. So where "goals made" > "goals-against". Can anyone help me get started on this one. The goal is to have a statistics page in the end. Thx a lot for helping me out


title: First Byte Time (back-end processing)

text: Do you have any tips for reducing First Byte Time back end processing... I disabled most of the plugins I could, I am using CDN, W3 Total Cache.. but still the back-end processing time is around 3 seconds. Is this time acceptable? What else could be done? thanks Andy


title: The content not wrapped in paragraph tags with get_page_by_title()

text: I am using `$page = get_page_by_title('name')`; to get the contents of a page. When I echo `$page->post_content;` none of the content is wrapped in p tags like it is when run threw the normal wordpress loop using `the_content(`). Is there a different way I should get this data so it will contain the proper tags?


title: Custom field values in permalink

text: Is there a way to add a custom field value (if it exists) to the permalink?


title: "Matching" or "Linking" Two WordPress Pages: Custom Fields?

text: I'm helping with a custom multi language site. We have one page in English, then an equivalent page in French. I've got a "SWITCH LANGUAGE" link in the main container (next to the breadcrumbs) that takes you to the English home page if on any French page, and vice versa. Aside from using a plugin, how can I make this link more dynamic by having it point to the _equivalent page_ , whether French or Engligh? E.g. when a user is on the "Events" page, the l ink points to the "Evènements" page, but when on the "Fundraising" page, it points to "Levée de fonds" page. Here's the code I'm using now to switch languages, using custom fields to give all Engligh pages a Name of "MenuName" and a Value of "English". This then serves either the breadcrumbs.php or my new breadcrumbs-en.php, which has the appropriate link to it. I don't think this is the best way to do this however, since it is dependent on the breadcrumbs.               <?php          if (get_post_meta($post->ID,'MenuName', true))       {       get_template_part('includes/breadcrumbs-en','page');       }     else       {       get_template_part('includes/breadcrumbs','page');       }     ?>      So I'm looking more for the theory of linking the two pages, by way (I think) of assigning custom field values for each page(?)


title: Sidebar menu based on user role

text:
This is a follow up to my own topic: Show menu in sidebar if on specific page AND specific user role (is_page, current_user_can) It didn't quite work as intended. To recap, I want to show a different sidebar menu depending on the role of the currently logged in user. Some pages overlap. For example, page: **my-account/same-page-for-all** may be in both sidebar menus - for CustomRole1 and for CustomRole2. This went into the functions.php               function get_user_role() {     global $current_user;          $user_roles = $current_user->roles;     $user_role = array_shift($user_roles);          return $user_role;     }      Then, in the sidebar.php I use this:               <?php     if (is_page(array('page1','same-page-for-all')) && get_user_role('Administrator','CustomRole1')) :         echo '
Title 1
' .         wp_nav_menu(array('theme_location'=>'menu1' ));          elseif (is_page(array('page2','same-page-for-all')) && get_user_role(array('CustomRole2','Administrator') :         echo '
Page 2
' .         wp_nav_menu(array('theme_location'=>'menu2' ));          endif;     ?>      The problem with this is that **when the same page is in both statements** , it defaults to the first menu. Even if I'm logged in as CustomRole2 user, it still shows the menu for the CustomRole1 users.


title: Hide/Show panel not showing - ACF

text: I came across strange thing. I have been using ACF for a quite a long time now and I love this plugin, but I tried to use it for new project and when I create group of fields for my pages show/hide panel is not displaying and all fields are floating, i'm not sure what might be causing that unless there is some option which isn't selected. http://grab.by/h50W


title: How to check if I am in admin_ajax?

text: Right now for my plugin, I am using `in_admin()` to determine if the user is in the frontend of the site or in the admin area. However, the problem occurs when plugins use `admin_ajax.php` to process ajax requests. I need a way to register hooks and plugins only when processing `admin_ajax.php` or in the frontend of the site. What is the best way to go about doing that?


title: Can I have Post Types under other Post Types in Admin menu?

text: Lets say I have created two custom post types `A` and `B`. Those post types are displayed in the Admin menu one after another. (After `Posts` for example) Is there a way to display `B` under `A`? The only similar behavior I am aware of is to assign Taxonomies to Post Types. This forces the first to be displayed under the second. I am looking for a way to do this using custom post types. It's like having relationships across post types. _I am managing post types and taxonomies using the excellent`GD CPT Tools` plugin. Wordpress 3.4.2_


title: Show Sitename on Yoast SEO Title tag

text: I am using Yoast SEO plugin on a site. Right now if a Post's Title is left empty in the metabox for a post, then the Title tag will output in this format...               %%title%% %%page%% %%sep%% %%sitename%%      Now if that same post does have a custom title text saved in it's meta field...then it shows only the text from the meta. What I need to do is show `%%sitename%%` after the titlte text no matter what! So even a title that is saved as `This is my title` the output on the HTML page will be...   `This is my title - SITENAME` Does anyone know how to do this?


title: One Login details in 2 E-commerce website

text: I've created 2 ecommerce websites the Chinese version and English version. What I want to happen is to have 1 login details in both sites. Is this possible? How? Please can anyone help me with this?


title: How do I add a current class to the current post?

text:
I have this list set up of the latest 7 posts:
                 <?php                 global $post;                 $args = array( 'numberposts' => 7 );                 $myposts = get_posts( $args );                 foreach( $myposts as $post ) :  setup_postdata($post); ?>
                         <a href="<?php the_permalink(); ?>"><?php the_title(); ?>
<?php the_author(); ?>
                 <?php endforeach; ?>
      How can I have a class of 'current' be displayed for the current post?


title: WordPress Screwing Up 'orderby' => 'meta_value_num' in 'pre_get_posts'

text: I have a bunch of `_ai_price_int` meta values set up as just numbers. This is how the table looks:               meta_id, post_id, meta_key,      meta_value     1309,    1111,    _ai_price_int, 6550     1310,    1115,    _ai_price_int, 7100     1311,    1113,    _ai_price_int, 7500     1312,    1103,    _ai_price_int, 6000     etc.      I'm using a `pre_get_posts` filter to modify a particular query, like this:               public function filterQuery($query) {         $query->set('post_type', 'sponsorship');         $query->set('meta_key', '_ai_price_int');         $query->set('meta_value', '4000');         $query->set('meta_compare', '<=');         $query->set('orderby', 'meta_value_num');         $query->set('order', 'DESC');         return $query;     }     add_action('pre_get_posts', Array($this, 'filterQuery'));      But playing around with `$query->set('meta_value', '4000');`, it turns out that the results are incorrect.   * When using `2000`, I'm getting a post that has an _ai_price_int value of `15000`.   * When using `4000`, I'm getting a post that has an _ai_price_int value of `35000`. I tried using:                   $query->set('post_type', 'sponsorship');         $query->set('meta_key', '_ai_price_int');         $query->set('orderby', 'meta_value_num');         $query->set('order', 'DESC');         $query->set('meta_query', array(             array(                'key' => '_ai_price_int',                'value' => array(0, 4000),                'compare' => 'BETWEEN'             )         ));      instead, but the results are the same. Looking at the performed query, I can see that it has this portion:               ...AND ((wp_13postmeta.meta_key = '_ai_price_int'AND CAST(wp_13postmeta.meta_value AS CHAR) <= '4000') )...      **Don't tell me that WordPress is ordering these values alphabetically?!** I'm also saving this custom value as an integer explicitly:               $price = (int)preg_replace("/([^0-9\\.])/i", "", $match[1]);     update_post_meta( $post_id, '_ai_price_int', $price );      What am I doing wrong? I'm testing on WP version: 3.5.2


title: How to add download to post & more?

text: What is the correct way of adding downloadable content to posts? More complex situation: I have a portfolio, and sometimes I do stuff that is meant to be freebie and I want it to be downloadable. Additionally, I want my portfolio page (custom portfolio archive page) to show a little icon on each portfolio item (custom post type element). And of course perfectly, without using any plugin. I was thinking of adding additional custom field, with download link and on archive page just make an if statement: if custom field download not empty - show icon... However this solution is not really flexible. In case I would ever decide to show download count or do anything else with it (also, maybe any suggestions what could be relevant to track in downloads?) I am just looking for best practice and great ideas. Thanks!


title: Widgets in PHP files?

text: IS it possible to make every Widget on Wordpress in a different .php file?   I have one page that contains 12 elements, I want to make each of them   a Widget so it would be easier to manage/edit them later on, but it would be better   if it's from a php page rather then from a code block on the Admin panel.


title: Only show upcoming event or current events

text:
I've been working on this website event page > http://aishaarab.com/events/ everything is working but I have 2 problems:   1. I can't get it to only show upcoming event meaning when an event is past to not shoe it or not display it.   2. When I output the post_meta onto my page using `<?php meta('event-end-date'); ?>` my result format is 08-12-2014 i would like the month to be letters like this august 12, 2014. here is code:
              <?php // Let's get the data we need to loop through below     //$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $d = date("m-d-Y");     $today = date('Y-m-d', strtotime('-6 hours')); //define "today" format; note timezone offset of -6 hours     $args = array(         'post_type' => 'event',         'posts_per_page' => '3',         'post_status'  =>  'publish',         'meta_key' => 'event-start-date',         'orderby' => 'meta_value_num',         'order' => 'ASC',         'meta_query' => array(         'relation'  =>   'AND',         array(                 'key' => 'event-end-date',              'meta-value' => date('Y-m-d', strtotime('-6 hours')), //value of "order-date" custom field              'compare' => '>=', //show events greater than or equal to today              'type' => 'CHAR'             )         )     );     $the_query = new WP_Query( $args ); ?>               <?php if ( $the_query->have_posts() ) : ?>                                     <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>

               <?php if ( '' != get_the_post_thumbnail() ) { ?>     <a class="post_img" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">     <?php the_post_thumbnail('event-thumbnail'); ?>          <?php } else { ?>     <a class="post_img" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">               <?php } ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?>

      Start Date: <?php meta('event-start-date'); ?>
     End Date: <?php meta('event-end-date'); ?>
     Time: <?php meta('event_time'); ?>

Location :
<?php meta('event_address'); ?>, <?php meta('event_city'); ?>, <?php meta('event_state'); ?>, <?php meta('event_country'); ?>

     <a class="read_more" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">Read More

                                  <?php endwhile; else: ?>
              <?php _e('Sorry, no events matched your criteria.'); ?>
             <?php endif; ?> <?php //wp_reset_query(); ?>


title: VideoJS in a Widget?

text: I'm trying to get VideoJS plugin to work in a Widget.   I tried to add a PHP widget and write, as it said in the manual:                 [video mp4="http://video-js.zencoder.com/oceans-clip.mp4"]      But it just shows the code as is, any ideas?


title: How to set post expiration date and time and move the page to archive after expiration

text: My requirement is to move the certain posts from home page category after specified date and time. I have two category News and Events. Both have so many posts and i dont want to show all the posts on home page. So how can i set the date and time to move the post from home page to archives.


title: Removing Parent Page URL While Keeping the Navigation Intact

text: So here is the current format: site.com/parent-page/child-page/ - example 0 Child-page is ranking higher than parent-page, which is not what I want. So, I have a solution. site.com/parent-page/ - example 1 site.com/child-page/ - example 2 In the child-page I will have a breadcrumb on the top, like this: Home -> Parent Page -> Child Page The parent page already has a virtual SILO, so we are building another virtual SILO for child page. My question is this: Q1. How can I remove the parent page URL from example 0 to make it look like example 2? Q2. How can I make sure child-page still points to parent-page after implementing Q1?


title: How to retrieve the post_id of a tag page?

text: Thought this would be straight forward... given a tag page such as `http://domain.com/blog/tag/tag-1/` how can I retrieve the `post_id` while on that page? The usual suspects such as `url_to_postid` and `$post->ID` or `$wp_query->post->ID` do not return anything. The hook that calls the function is running during `init`. Thanks!


title: Version control with a team of non-developers

text: At work we have decided to redo our website from scratch since over the years it has been plagued with no version control or dev site, plugin inconsistencies, etc. The team who created the current site were a bunch of designers and a few others with basic wordpress editing skills. Needless to say the site is an awful hack job. I am currently the only developer, but some of the designers & others are still in place. I'm in charge of creating a new workflow that works for everyone. I'm really not keen on teaching git to everyone that will edit this site nor do I trust any of the rest of the team to have control like that. All that being said, since I am the only developer but we NEED to version the new workflow, what are some suggestions? I suppose I will be the only one creating and editing plugins, etc., but my designers do know how to create their own templates, etc. so they will be editing and adding code. So the question is: Is there any happy medium that will allow my designers to edit the theme files and push them live without having to teach them version control?


title: wordpress forms submit

text: I am new to wordpress. I am trying to develop a website where I want user registration form. But I am not sure how should I code in wordpress. I heard about some contact form plugins. Can someone direct me to some good tutorial or post about how to work with form submits in wordpress?


title: Could be a namespace conflict (?) with login form and register form on the same page

text: I have created a "My Account" page template for WP 3.5.2 that displays certain custom data if a user is logged on. If not, the page displays a login form and a link that opens the register form in a fancybox, plus some other info for the app. The mechanics of the display work fine, and the rendered page passes the HTML syntax check with the typical exceptions in the head section. **The problem:** I can get only one form to work at a time. If the login form is working, then the register form will not, and vice versa. That is, if I disable one the other works. When both are enabled and share the same value for input element attribute "name", e.g. "user_login", one will fail. Both cases result in the same error message: > undefined index user_login at line 530 in wp_login.php I have tried creating unique ids on the input elements named 'user_login' but that did not cure the problem. Sample of my code: http://pastebin.com/fevRMjHi I would be most grateful if someone can suggest how to improve the code so the cause of the problem is revealed. Of course a resolution outright would be very nice too.


title: Using AJAX in wordpress theme

text: all In my theme there is a notification at top. After user login he can see the notification update. when click on notification i want to make change in database alert field value 0 to 1. My ajax call in theme                $("#notifications-button").click(function() {                  $.ajax({             type : 'POST',             url: "http://localhost/rupp/wp-admin/admin-ajax.php",             data:{action:'MyAjaxFunction'},             success : function(data){                 $('.message-count').hide();             },                  });               });      and in function.php file               add_action('wp_ajax_MyAjaxFunction','MyAjaxFunction');     function MyAjaxFunction()     {         global $wpdb;       echo (int)$user_ID;       $wpdb->update( $wpdb->wp_frm_items,                  array( 'alerts' =>  1)                 );     }      but it not make any changes in alert fields in db. is that right way to call theme function using ajax?


title: Overwrite WP's default search rule to redirect to my own template

text: As usual, rewrite stumped me! I've built a custom search for searching through comments and comment meta, using a flat table. I'm using a rewrite rule as follows:               ..../search/reviews/<parameters>      I'm sending a query var 'args' which is group of key/val pairs to search against, to my custom template which has the sql and stuff. This works fine. My problem is, when I search as follows,               .../search/reviews/      Here I'm sending no params, hence I want to either redirect to 404 or just redirect to that same template with args as blank, where I'd see that args is blank and hence show all the results directly. I wrote the rule:               add_rewrite_rule('^search/reviews/','index.php?pagename=search-results','top');      But it still works as default search, searches for the keyword 'reviews' (like WP does for 'hello'.... `/search/hello`) and doesn't redirect to my template. Any help on how to avoid this behavior?


title: Restricting access to a single MultiSite site based on IP -- possible?

text: I have need to restrict not just admin access but also access to the content stored on a single site in a MultiSite network based upon a user's IP address.   1. Is this even possible?   2. Is there an easily admin-able plugin? (I _could_ restrict access using something like Justin Tadlock's "Members" plugin, but the requirement in this case is based on IP.)


title: Sending WP posts to external API

text: What's the best method for sending all new Wordpress Posts to an external script on another server? It needs to include the full post information including the post content, so a simple ping is not sufficient. I've looked at how Wordpress Plugins work (without having any past experience) and the publish_post and edit_post actions seemed to be along the right lines, but i've had a few issues with the data being sent not being up to date e.g. edit_post sends a post_id I use get_post() and the data provided is the old data. The other rather large issue with this is that it would probably require using CURL to send the post to the external server, which not all sites will have access to. The only other solution I can think of is to attach a function to wp_init() to intercept any requests coming from my server. To clarify this would involve my server requesting the WP index with a custom user agent such as "mysite/1.0". If this custom user agent is detected the plugin would output something itself and then exit preventing the standard WP output. That way I could use the built in ping service to ping my server from wordpress, get the permalink from this ping and then send a request back to WP which will be intercepted by my plugin and output the post as json. Does this sound feasible? Is there another commonly used method to send an entire post to an external script that i'm not aware of? I'm very new to Wordpress and don't actually use it myself, but i've been asked by people who do use Wordpress how they can get their content automatically imported to my site, so I said i'd look at creating a plugin to do so :)


title: Need to return shortcode text instead of the output

text: Is there a way I can return the shortcode text instead of the output. My code function is hooked into 'the_content' and I know if my function contain shortcode it will automatically generate the output. I just want to output shortcode text e.g [gallery]               add_filter( 'the_content', 'show_on_front', 10 );     function show_on_front( $content ) {        $content .= 'this is example of shortcode : [gallery]';        return $content;     }      Regards,


title: Wordpress triggers 404 on page 2 for custom search query

text: I modified my index.php to check if the search query is an author and if yes, display articles of that author. That is working fine but as soon as you go to page 2 of the results, wordpress triggers a 404 error. So I guess Wordpress is not calling the index.php on http://www.test.com/page/2/?s=my+search+query and I also need to put the code I got in my index.php somewhere else, but where? Edit: My code for the custom query               $author_res = $wpdb->query("SELECT ID FROM $wpdb->users WHERE display_name LIKE '%".get_search_query()."%' LIMIT 1");         if($author_res > 0) {             $author_info = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE display_name LIKE '%".get_search_query()."%' LIMIT 1");             $article_query = new WP_Query('posts_per_page=7&paged=' . $paged.'&author='.$author_info->ID.'&offset='. $offset);             if($article_query->have_posts()){     ...      $paged and $offset get calculated sitewide but that works fine. I guess the problem is somewhere else, I'd like to debug this but I don't know where wordpress decides if it triggers the 404 and I don't know which php file gets triggered on /page/2 because it seems like it's not index.php


title: Home page for a category / taxonomy

text: I don't know why WP themes do not support taxonomy homepages. I mean there should be a separate template for `example.com/location/` (this may show a list of available taxonomy terms etc.) in addition to `example.com/location/newyork/` where location is a taxonomy. What is the best way to have a taxonomy home? A page with slug=location and custom template?


title: Getting (Invalid) when adding custom taxonomy of custom post type link in menu

text: I am getting this message when I am trying to add a link to my menu: ![screenshot](http://i.stack.imgur.com/1IDME.png) I have created a custom post type and a custom taxonomy               <?php        /*        Plugin Name: Portfolio - Custom Post Type        Plugin URI:         Description:         Version: 1.0        Author:        Author URI:         License:        */     ?>     <?php          // ----- Register custom post type ------ //          add_action( 'init', 'create_post_type_portfolio' );          function create_post_type_portfolio() {         $labels = array(             'name'               => _x( 'Portfolios', 'post type general name' ),             'singular_name'      => _x( 'Portfolio', 'post type singular name' ),             'add_new'            => _x( 'Add New', 'job' ),             'add_new_item'       => __( 'Add New Portfolio item' ),             'edit_item'          => __( 'Edit Portfolio Item' ),             'new_item'           => __( 'New Portfolio Item' ),             'all_items'          => __( 'All Portfolio Items' ),             'view_item'          => __( 'View Portfolio Item' ),             'search_items'       => __( 'Search Portfolio Items' ),             'not_found'          => __( 'No Portfolio Items found' ),             'not_found_in_trash' => __( 'No Portfolio Items found in the Trash' ),              'parent_item_colon'  => '',             'menu_name'          => 'Portfolio Items'         );         $args = array(             'labels'        => $labels,             'description'   => 'Holds our Portfolio Items and Portfolio Item specific data',             'public'        => true,             'menu_position' => 5,             'menu_icon'     => plugins_url( 'portfolio.png', __FILE__ ),             'supports'      => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments' ),             'has_archive'   => true,             'show_in_nav_menus' => true,             'rewrite'       => true,             'show_ui'       => true,              );         register_post_type( 'portfolio', $args );        }          // ------------- register taxonomy ----------------- //          // hook into the init action and call create_portfolio_taxonomies when it fires     add_action( 'init', 'create_portfolio_taxonomies', 0 );          // create Work for the post type "portfolio"     function create_portfolio_taxonomies() {         // Add new taxonomy, make it hierarchical (like categories)         $labels = array(             'name'              => _x( 'Work', 'taxonomy general name' ),             'singular_name'     => _x( 'Work', 'taxonomy singular name' ),             'search_items'      => __( 'Search Work' ),             'all_items'         => __( 'All Work' ),             'parent_item'       => __( 'Parent Work' ),             'parent_item_colon' => __( 'Parent Work:' ),             'edit_item'         => __( 'Edit Work' ),             'update_item'       => __( 'Update Work' ),             'add_new_item'      => __( 'Add New Work' ),             'new_item_name'     => __( 'New Work Name' ),             'menu_name'         => __( 'Work' ),         );              $args = array(             'hierarchical'      => true,             'labels'            => $labels,             'show_ui'           => true,             'show_admin_column' => true,             'query_var'         => true,             'show_in_nav_menus' => true,             'rewrite'           => array( 'slug' => 'work' )         );              register_taxonomy( 'Work', array( 'portfolio' ), $args );     }                    ?>      Why ?


title: Returning Variables back into a template

text: If I put a function that I want to use in a template I can put it into functions.php               function myfunction(){     echo 'My String';     }      `add_action('myfunction','myfunction');` and in a template file put:               do_action('myfunction');      This appears to only work if writing something out to the screen. If I wanted to return a variable instead to the page. E.g.               function myfunction(){     return 'My String';     }          $string = do_action('myfunction');      and capture it instead of print it. How would I do it?


title: How can I display the total number of favorites for any particular buddypress activity stream post?

text: I like to show the total number of favorites for each individual activity post next to the favorite button just like it shows the number of comments right next to the comment button. Is this possible to implement?


title: Featured image size per post type

text: Hi I have several featured image sizes I need to use throughout the site, some of them pertaining to custom post types. Could I set them in some way so that the image sizes are not created for the featured images of all posts/pages but only to the custom post types where they will actually be used? I want this in order not to bloat the installation with a lot of different sized images. Thanks


title: Unable to find API Key for my blog

text: I have the blog http://kracekumar.wordpress.com, I need to find the API KEY of my blog,I clicked on Global Dashboard->My profile,it was mentioned in wordpress site that it will be found in top left side,but I can't find it.


title: Disable image attachment links

text: Is there a way to disable image attachment links trought a filter in functions.php or something ? I know it's possible to do it manually when you add an image to a post but I want to disable this functionality by default. **UPDATE** What I want to do is set the "Link URL" option to "none" and remove / hide it from the upload attachement screen. ![enter image description here](http://i.stack.imgur.com/NiIar.png) Is there a solution to hook into the "media-upload" "pop-in" ? Thanks by advance.


title: Best way to programatically add "rel" attributes to page and post images

text: For single posts and pages, I would like to add certain `rel` attributes to all the images on the contained therein added with the "Add Image" functionality on the edit screen. The attribute would be `rel="lightbox[post id]"` What function would I filter to accomplish this most effectively?


title: How do i put a sidebar on my post permalink page?

text: I am using the twenty-eleven theme and every page (except the 404) has a sidebar. However the post permalink page (/2011/11/post-name/) does not. How do i put the sidebar onto it? I tried looking for its php file on codex but it is very unclear which file is the correct one.


title: How to exclude parent category but show child categories?

text:
I figured out how to exclude the current post from displaying in my single- post view sidebar, but now I want to exclude parent categories and display only children. Any ideas how to do this? Much obliged!!

Similar Items
     <?php         if ( is_single() ) {         $cats = wp_get_post_categories($post->ID);         if ($cats) {         $first_cat = $cats[0];         $args=array(           'cat' => $first_cat, //cat__not_in wouldn't work           'post__not_in' => array($post->ID),              'showposts'=>8,           'caller_get_posts'=>1     );         $my_query = new WP_Query($args);         if( $my_query->have_posts() ) {           echo '';           while ($my_query->have_posts()) : $my_query->the_post(); ?>          <?php if (in_category('15')) continue; ?>

<?php get_the_image( array( 'custom_key' => array( 'thumbnail' ), 'default_size' => 'thumbnail', 'width' => '119', 'height' => '75', 'link_to_post' => true ) ); ?>

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

            <?php           endwhile;         } //if ($my_query)       } //if ($cats)       wp_reset_query();  // Restore global post data stomped by the_post().     } //if (is_single())     ?>


title: Related sub category posts with thumbanils

text:
I want to show sub sub category posts and title Like   * Parent Cat   * Sub Cat   * **Sub Sub Cat** <--- I use the following code but shows me all posts from Parent cat , sub cat and sub sub cat posts.               function related_posts(){         global $post;         $categories = get_the_category($post->ID);         if ($categories) {         $category_ids = array();         foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;              $args=array(         'category__in' => $category_ids,         'post__not_in' => array($post->ID),         'posts_per_page'=> 5, // Number of related posts that will be shown.         'ignore_sticky_posts' => 1         );              $my_query = new wp_query( $args );         if( $my_query->have_posts() ) {         $categories = get_the_category();         echo '

 cat_ID). '"> '. $categories[0]->cat_name .'

';         while( $my_query->have_posts() ) {         $my_query->the_post();?>

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

          <a href="<?php the_permalink()?>" title="<?php the_title(); ?>"><?php the_title(); ?>
                <?php         }         echo '

';         }         }         wp_reset_query(); }


title: Need to check if user is on a particular page

text: Here I hope is a simple question for a php newbie. I have a textbox on my blog's home page that contains a link to another page. Should the visitor click the link and go to that page, I want to be able to check to see if the user is there so I can change the text and CSS. I know how to use the ishome() function, but what function do I use to check if the user is on the page in question? It's not a post, just the mysite.com/what-we-do page. Thanks.


title: How do I change the default admin color scheme in MP6

text: How do I set a different default admin color scheme for all users? For example, it's set to MP6 as default now, but I want to make it MP6 light by default. The users may or may not change it later! What I've learnt so far is that it could be done by hooking into `get_user_option_admin_color` Here's the code from the plugin author:               <?php          add_filter( 'get_user_option_admin_color', function( $color_scheme ) {     global $_wp_admin_css_colors;          if ( ! isset( $_wp_admin_css_colors[ $color_scheme ] ) ) {         $color_scheme = 'ectoplasm';     }          return $color_scheme;          }, 5 );      But as a non-savvy I couldn't figure out where to put this code to make it work. Can anyone help me?


title: Is there a naming convention for database tables created by a plugin?

text: I have setup my plugin's table to use $wpdb->prefix but aside from that are there any conventions that you should name them; Maybe `$wpdb->prefix.'plugin_'.$tablename` or something. I can't find any documentation and the examples of plugins I have used in the past don't seem to adhere to anything in particular.


title: get_the_tags Conditional display of a custom taxonomy

text:
I'm currently using the below code for displaying standard post tags in a sidebar, given the current post has one associated with it. If not, no tag & accompanying headline, etc., should be displayed. Also, the usual /tags slug should be removed in the URLs, respectively. Again, my below code does that, which is exactly what I want. However, how can I accomplish the same thing with a custom taxonomy of, say, "rivers"? Your guidance is much appreciated as I've tried several things already, to no avail. The current code (in use for standard post tags):               <?php         $tags = get_the_tags();         if ($tags) {             echo '
Holiday Regions

';                 foreach ($tags as $tag) {                     echo 'slug . '" title="' . sprintf( __( "Learn more about the %s" ), $tag->name ) . '"' . '>' . $tag->name.'
             ';                     }             echo '
';             }         ?>      * * * For those who are in a similar situation, here's what did the trick—thanks to the hint from @Michael:               <?php         $terms = get_the_terms( $post->ID, 'rivers' );         if ($terms) {             echo '
Rivers

';                 foreach ($terms as $term) {                     echo 'slug . '" title="' . sprintf( __( "Learn more about the %s" ), $term->name ) . '"' . '>' . $term->name.'
             ';                     }             echo '
';             }         ?>


title: Is there a way to define the $post var outside the loop?

text: I am trying to speed up a wordpress site by condensing three wp_queries into one. I have a need to seperate categories, so I am making the call and defining 3 arrays to hold the post using a switch, like so:                $new_query = new WP_Query();                     $new_query->query('post_type=post&paged='.$paged);                     if ( $new_query->have_posts() ) : while ( $new_query->have_posts() ) : $new_query->the_post();                                   $category = choose_one_category(get_the_category());                          switch ($category){                         case "Category 1":                             $cat1[] = $post;                             break;                         case "Category 2":                             $cat2[] = $post;                             break;                         case "Category 3":                             $cat3[] = $post;                             break;                     }                               endwhile; endif;      which leaves me with 3 arrays which with the posts nicely sorted. Now I wish to define the variable $post OUTSIDE the loop so that I can use methods like `the_date()` & `comments_number()` without having to rewrite those functions, can anyone help? I have tried:                                   foreach ($centre as $new_post){                             $post = $new_post;                                                       include('front_page_loop.php');                         }       Where `front_page_loop.php` is my loop code, but I just get the same post, albeit with different dates


title: Which core file(s) handle $_POST and $_REQUEST?

text: I have a wordpress site with a subdirectory which should be excluded from the wordpress environment. I have tried to exclude it via .htaccess, and I have tried to make sure my form element names don't match any of the reserved words. However, some form submissions in this directory still result in a wordpress 404 error. These errors come from the values of the form fields rather than the names, as the names work fine for other values. For instance, a user tried to use the name "pokerstars", and that hit a 404. It's repeatable with that particular name every time, but other names go through without issue. This is just one of the instances that result in a wordpress 404 that wordpress shouldn't be messing with in the first place. That being said, I want to modify the wordpress core to not execute whatever block(s) of code deal with $_POST and $_REQUEST variables. Where can I find them?


title: Cannot add / edit categories to a post anymore

text: I had to modify a published post and for some unknown reason, it removed the categories the post was in. I tried reassigning them, but it does not work: WordPress does not save the categories, so the post ends in the default "unclassified" category. I've checked and it happens also if I create a new post. So it's a quite strange issue. I deactivated my caching plugin, to no avail. Any idea what provokes this bug?


title: What are options are there to implement a multi language site

text: **What is the best way to have multiple languages on a site?** I was thinking of using WP3.0 and then having each language of the site being a seperate blog in a sub directory. I.E.   * `example.com`   * `example.com/fr/`   * `example.com/de/` And then just being able to have one theme that all the sites share. Is there a better way to do this? What do you think?


title: How to use query_posts() with a date filter on a custom field?

text: I have defined a custom post type that uses a meta field to store dates. In my functions.php I have the following code which saves the start date. The format of the date that is sent in the `startdate` form parameter is `2010/12/01 9:00 AM`               add_action('save_post', 'save_details');          function save_details(){         global $post;         update_post_meta($post->ID, "startdate", $_POST["startdate"]);     }      I am trying to output a list of all the events with a `startdate` later than the current time.               query_posts(array(         'post_type' => array('seminar'),         'meta_key=startdate',         'meta_value='.date("Y/m/d h:i A"),         'meta_compare=>'     ));      This lists out all the events regardless of their start date. What am I doing wrong? ## SOLVED: For some reason after I changed my code to the following, it just works.               $args = array(         'post_type' => array('seminar'),         'showposts' => 3,         'meta_key' => 'startdate',         'meta_value' => date("Y/m/d h:i A"),         'meta_compare' => '>',         'orderby' => 'meta_value',         'order' => 'ASC'     );          $seminars = get_posts($args);      I am going to select the answer from @Rarst as the accepted one, because I think I actually had multiple issues going on here, but his addressed the issue related to the title best. @sorich87 had a good point about how I should have been storing the dates as timestamps, but in the end, @Rarst was correct that if I specified a format argument to the `date()` function which matches the format I used when storing the data into the database, then I should be able to compare the data. Thanks for all the help.


title: Checking current language in a function

text: I am running WordPress with "WPML Multilingual CMS", so that it has multiple language versions. In a function used with `add_action('template_redirect',<functionname>)`, I need to find out what the current language is. What should I call?


title: Orders being sent to wrong admin email in WooCommerce

text: I set up an admin User for myself to create the site, then another for my client to use. I changed the emails in WooCommerce to her address wherever I can find them, but the orders are still coming to me. I don't want to remove my admin account (see: clients touching stuff). Where do I set this to make sure those orders come to her and not me? Thanks!


title: Custom size for image uploaded to custom field in user profile?

text: I'm using advanced custom fields and set an image upload field in user profiles. I'm using this image a few places on the website and need to set a custom size for it on some pages. If I set `add_image_size( 'homepage-thumb', 190, 259, true );` in my functions file how can I use this image size with the uploaded image since it's not a featured post or page image? From my home page this is how I get the image `$author_logo = get_field('author_logo' , 'user_' . $author_id ); // image field, return type = "Image Object"` then `<img src="<?php echo $author_logo;?>" />` Thanks


title: using nav menu id's

text: I am trying to make a WP_Query that gets all pages / posts from the navigation id. I have the id's. I have a variable that holds the numbers and when I echo it out, this is exactly what I get 7,43,20,22,16,1051,18,26,9,24,28,10523 Reading in the codex, I should be able to use page_id. When I refresh the page, I do not get any posts or pages. Having tried many different versions of this query, this is where I am at right now.                $page_query = new WP_Query( array('post_type' => array( 'post', 'page'), 'page_id' => array($number)));


title: language theme and multisite

text:
i have a problem i can't solve, i made a theme with two languages support, italian as standard and english using the .po and .mo files (located in the /lang/ folder inside the theme), everything works smooth in a single website, if i change `define('WPLANG', 'it_IT');` to `en_EN` in the `config.php` the website switch with no problem. The problem is when i use it in a multisite network, even if change the language for the single website in the `site language` option, the theme doesn't change the language, what am i doing wrong? I can't find a solution, i did all wordpress say in the internationalization page i named the text domain as the "slug" of the theme               /*        Theme Name: translate test     Theme URI:      Description:      Author: Fab     Author URI:      Version: 1     Text Domain: translate-test     */      i loaded the theme textdomain correctly               <?php     add_action('after_setup_theme', 'my_theme_setup');     function my_theme_setup(){         load_theme_textdomain('translate-test', get_template_directory().'/lang');     }     ?>      and this is the index.php (for example)               <!DOCTYPE html>               <meta charset=utf-8 />     <title>translate test</title>     <link href="<?php bloginfo('stylesheet_url');?>" type="text/css" rel="stylesheet" media="all">
<?php _e('questo è un test','translate-test')?>
                What am I doing wrong?


title: Change the file path on get_template_part via plugin

text: I'm trying to make a plugin that will change the behavior of a theme. In the theme file I have a `get_template_part('libs/templates/user_menu');`. I want to make my plugin "force" the `get_template_part` to return another slug file (a path to a file in the plugin's folder). So far this is my code inside the plugin:               function wpse21352_template_part_cb( $slug )     {         if(slug == 'user_menu') {              return WP_PLUGIN_URL.'/'.$slug;         } else {              return $slug;         }     }          do_action( "get_template_part_user_menu", 'user_menu' );     add_action( 'wpse21352_template_part_cb', 'get_template_part_user_menu', 10, 1 );


title: Using query_posts inside single.php loop

text: Inside of my loop in single.php, I used a custom query using `get_posts` to return posts belonging to a certain category.               <?php                                                   global $post;                                                             $paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;                                                             $myposts = get_posts("paged=$paged&category=5");?>          <?php foreach($myposts as $post) :?>          <?php the_title();?>          <?php endforeach; ?>      The problem is that the original loop, which is the single.php loop, seem to do not work after the execution of the query. For instance, the navigation links (next and previous) dont work. Have you ever faced this issue? your help is appreciated.


title: Can't find where to modify <html> attrbitutes

text: I am trying to create a simple function that adds or edits data in the `<html>`. Basically, before the server response is sent, I want to find where this piece of html is written at the top level of the page               <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">      And based on certain criteria, add a new property & value that tag.               <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US" myprop1="val1" myprop2="val2">      Is there an action or filter I can hook into, at it's earliest to modify this? Most likely using regex? Side note, I understand how it break validation, but I need this for my purposes. **Update** To answer couple questions:   * I know I can insert variables inside of html tags with just PHP. The problem is I can't find where in the WP core the actual starting `html` tag is being generated so I can replace or modify what's being generated.   * This will be in a plugin, theme independent, where the html tag is unknown, but 99% of the time it will be the standard output from Wordpress   * I can't use the header.php in a theme, as I would like this to work on whatever theme is installed. Is this specific tag always generated from the theme? Any way to override theme generated tag (if user specifies this) within a plugin?


title: How to redirect users to their profile after they successfully edit their profile

text: I am using the buddypress plugin for wordpress and would like to make a little change... I was wondering, if there was a way I could redirect users to their profile page after they save the edits to their profile page? Basically, when a user edits their profile page it just shows a message that says something like “changes saved” but stays on the edit page. I would like it to redirect to the user’s profile page so they can see the changes after they click the save changes button and it was successful. I am thinking of using something like this:               function EditsSaved()     {     global $bp;     wp_redirect( $bp->loggedin_user->domain );     }     add_filter( 'SomethingHere', 'EditsSaved' );      I am a little unsure how to do this... what would I need to put in the 'SomethingHere' part that will fire when someone successfully saves the edits they make to their profile? I have tried some code I found online but it did not work. I am using wordpress 3.8 and buddypress 1.9.1 **Update:** Alright, I figured it out! It was just an issue off trying to use outdated code... Here the function that works:               add_action( 'xprofile_updated_profile', 'SaveEditsRedirect', 12 );     function SaveEditsRedirect() {     global $bp;     wp_redirect( $bp->loggedin_user->domain );     exit;     }


title: Javascript block in Twenty Twelve theme

text: I am authoring a WP plugin, and I have to generate some JS (jQuery) code in "realtime". It is working fine in general, though I've stuck with one problem with the WP 3.5.1 and its default Twenty Twelve theme: there the scripts are inserted in the footer of the page, not in the header, causing my code to throw errors. I've looked through all the theme's files (header, footer, functions), and I can't seem to find the reason for that. Looks like the `wp_footer()` is inserting the block, but I can't find any hook or anything else that tells WordPress to insert scripts there. So, my question is: how to make jQuery and other scripts go in the header by default, not in the footer? What does make the theme work this way (maybe the default WP behavior changed?)


title: TinyMCE Advanced list type drop-down

text: I want to be able to change the list-style-type, for example:               list-style-type: circle;     list-style-type: square;     list-style-type: lower-roman;     list-style-type: lower-alpha;     ...      In the plugin directory for TinyMCE Advanced There is a screenshot that shows what appears to be a drop-down menu to do just that. ![enter image description here](http://i.stack.imgur.com/KXN8Z.png) My installation doesn't seem to have that feature. Is there something I need to do to enable it? ![enter image description here](http://i.stack.imgur.com/rTgBH.png)


title: check first time login only wordpress

text: i want to display welcome message or redirect the user to my custom template when the user login for the first time only. After the user can visit the regular page of the site.


title: Disable gallery in 3.5 media iframe

text: I'm creating a setting to set a logo. It works but there is a problem.   I only need one image to be set so the gallery item should be disabled / hidden. Of course this should only effect this page, of even better this setting.               <?php     // above this I do a simple settings api     ?>     <input id="set_logo" type="text" size="100" name="set_logo" value="<?php echo esc_attr( $value ); ?>" />     <?php     do_action( 'media_buttons', 'set_logo' );      I've looked in multiple places in code but I can't find any clues how to do this. **EDIT**   I've solved it in a different way that is not related to this. The solution is now implemented in my first plugin: http://wordpress.org/extend/plugins/default-featured-image/   _shameless plug._


title: Filter pictures in the media library

text: I have some issues with duplicated pictures in my media library and I would like to know if there is any option to show or automatically filter only certain images in the library. For instance, let's say that I have 20 pictures in the library: A.jpg (original), B.jpg (original), C.jpg (original), A1.jpg (duplicate), A2.jpg (duplicate), B1.jpg (duplicate), C1.jpg (duplicate), etc. I would like to see or to let see to other users only the first three pictures in the media library. Any idea how to do it with a plugin or modifying some files? Thank you


title: Best way to create a page outside of the pages list

text: Currently, to add a single page that should not be part of the CMS, I add a new Page entry in the WP admin panel and then markup the page in page-{page- slug}.php. This however causes the Pages list to contain pages that are not meant to be edited by the client/editor (title, content are irrelevant). How should I create these custom PHP pages without using the Pages system?   * The slug should still work and not be overwritable by new pages   * A php file should be linked dynamically like page-{slug}.php or /inc/{slug}.php


title: Add trailing slash to URLs not found

text: So I noticed that Wordpress automatically adds a trailing slash to URLs. I also noted that it doesn't do this for URLs that aren't found on the server. Why this probably is logical. Is there someway to make it rewrite not found URLs to add trailing slash?


title: How to insert image from link in TinyMCE

text: In the TinyMCE editor that comes with WordPress there is no button to insert image from link. I know that you can do this using the upload/insert section. But let us say that I don't want to allow users to upload images but want them to be able to insert images by linking them. If I remove the upload capabilities, the upload/insert section disappears altogether.   Is there already a method to do this on WordPress?


title: add new input field like category?

text: I want to create another input field like the categories. Whenever user posts a new question I want to have another drop down of locations associated with that particular question, like categories drop down in the the 'Submit Question' form. And how I can add a UI for managing it in the admin section like the one there exists for categories in Questions?


title: jQuery UI Tools (Flowplayer) Issues

text: As great as the jQuery Tools might be they're giving me a headache. I want something like this for my website. I have the necessary script included (and Scrollable works just fine btw.):               <script src="http://cdn.jquerytools.org/1.2.5/tiny/jquery.tools.min.js"></script>      I followed the minimal setup and also copied and pasted the source code from the standalone version. For some reason the content doesn't show up! If I get rid of the "display:none" command in the CSS the content shows up but overlayed. I'm not sure why it's not working. Please see here. EDIT: So, many days later I'm trying to get all the script calls out of my header and put them into my function.php instead. I also want to try and use no conflict wrappers. As far as I understand I should use               jQuery(document).ready(function($) {      instead of               $(document).ready(function(){      I found the latter in the contact.php of my parent theme. I replaced it with the first code and it stopped working!! Here's the whole script of the contact.php:                <script type="text/javascript">     $(document).ready(function(){                   $('#contact').ajaxForm(function(data) {                      if (data==1){                          $('#success').fadeIn("slow");                          $('#bademail').fadeOut("slow");                          $('#badserver').fadeOut("slow");                          $('#contact').resetForm();                          }                      else if (data==2){                              $('#badserver').fadeIn("slow");                           }                      else if (data==3)                         {                          $('#bademail').fadeIn("slow");                         }                         });                      });             </script>      Any idea why it doesn't work? I checked the jquery.form.js that it's based on and could it have to do something with that?               jQuery Form Plugin      * version: 2.07 (03/04/2008)      * @requires jQuery v1.2.2 or later      *      * Examples at: http://malsup.com/jquery/form/      * Dual licensed under the MIT and GPL licenses:      *   http://www.opensource.org/licenses/mit-license.php      *   http://www.gnu.org/licenses/gpl.html      *      * Revision: $Id$      */      (function($) {     /**      * ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX.      *      I need to fix all of this step by step, so I hope you'll help me out a bit here, thanks :) I really appreciate any hint you can give me. I tried to implement the scripts in the function.php instead of the header, but for some reason the scripts stop working then, so it's not an option.


title: Replace full content with an excerpt

text: My theme shows full posts on the main page and I want it to show only the summary, I tried searching for the_content tag in my theme's index.php file but it is not even there!   I don't have a home.php or category.php. I tried searching my whole wordpress installation for the_content and the only places i could find it is in page.php and even when changing it there it doesn't really work. The other places I found it in my theme formats (image.php, audio.php...) but changing it there makes the post shows the summary even when you click on it and go inside the post. My index.php file has this :               <?php if (have_posts()) : while (have_posts()) : the_post(); $format = get_post_format();  ?>            <?php if($format == ''): ?>              <?php get_template_part('library/functions/theme/formats/standar'); ?>                 <?php else: ?>              <?php get_template_part('library/functions/theme/formats/'.$format); ?>            <?php endif; ?>          <?php endwhile ?>      Do I need to do something specific there to make this work?


title: Trying to get property of non-object “ wordpress ”

text:
My WP theme got these notice on description menu function my code : http://www49.zippyshare.com/v/89513423/file.html               /* Discription Navigation Menu, Credit to Christian Kriesi  */          class description_walker extends Walker_Nav_Menu          {                function start_el(&$output, $item, $depth, $args)           {                global $wp_query;                $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';                     $class_names = $value = '';                     $classes = empty( $item->classes ) ? array() : (array) $item->classes;                     $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );                $class_names = ' class="'. esc_attr( $class_names ) . '"';                     $output .= $indent . '
ID . '"' . $value . $class_names .'>';                     $attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';                $attributes .= ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';                $attributes .= ! empty( $item->xfn )        ? ' rel="'    . esc_attr( $item->xfn        ) .'"' : '';                $attributes .= ! empty( $item->url )        ? ' href="'   . esc_attr( $item->url        ) .'"' : '';                     $prepend = '';                $append = '';                $description  = ! empty( $item->description ) ? ''.esc_attr( $item->description ).'' : '';                     if($depth != 0)                {                     $description = $append = $prepend = "";                }                      $item_output = $args->before;                 $item_output .= '';                 $item_output .= $args->link_before .$prepend.apply_filters( 'the_title', $item->title, $item->ID ).$append;                 $item_output .= $description.$args->link_after;                 $item_output .= '';                 $item_output .= $args->after;                      $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );                 }     }      my wp_nav_menu :                 $header_menu_args = array(               'theme_location' => 'main_menu',                                           'container_class' => 'menu',           'container_id' => 'dropdown',           'menu_id' => '',            'menu_class' => 'sf-menu',           'echo' => true,           'before' => '',           'after' => '',           'link_before' => '',           'link_after' => '',           'depth' => 0,           'walker' => new description_walker()                                       );       wp_nav_menu( $header_menu_args );       dropdown_menu( $header_menu_args );      the problem is in the line 44, 46, 47, 49 for the property of non object. http://multipixels.net/files/theme_function_debug.png please help me to figure it out please. Best regards, Decneo


title: Add new user and site per front end form

text: Do you know any multisite plugin which allows users to create a user account and a site after a form submission. After the form submission, the form will automatically add a site in the network admin and create a new user. Is this possible? Some say that it needs hardcoding for it to work. But I have no idea how to. Hope you guys can help.


title: Should I use the standard wp_mail() function for a premium theme?

text: I am creating a premium theme that includes a Contact page template. Currently, I am using the `wp_mail()` function to send the contact email to the administrator-specified email address. Basically, I am wondering if the `wp_mail()` function is the best/expected choice for implementing email functionality in a premium WordPress theme? If it is not, what would be the better option?


title: Get parent page/menu id of current post

text: Basically, after setting up the initial "page for post" on the Reading Options, and then add that page to the menu I get the posts when I click on that menu item as expected. On there I know the post ID (which is the actual page created before setting it as the page for posts) and all the information regarding that same page. Trouble is, when I click on a specific post, not only the menu item looses its active status, but I can't get hold of that parent page ID. Is there a way to get that parent page ID, when on a post !? **Edit:** For reference, I managed to get it with `get_option('page_for_posts');` but that's very ugly. Is not possible that the post associates with it's parent page index ?


title: Troll the hackers by redirecting them

text: My website is getting somewhat popular, and with the it's increasing popularity there's an increase in the hackers. Last night I visited my security logs and found that everyday approximately 10 people try to access                /?author=1      /?author=2      /?author=3      /?author=4      but I don't have any of these user IDs, so a 404 is generated to them. they also run a guessing bots on usernames:                admin      administrator      wordpress      Now, I want to troll them... so each time they try to access any of these two:                1. visiting /?author=1..etc      2. trying to login with admin username      I want their IP blocked off my site, and redirected to a youtube video. I know the first one can be done with .htaccess trick, but can't quietly get this trick. the second one I guess is done by php, but I have no experience with Wordpress although I'm pretty good with PHP.


title: Share buttons in some specific posts in WordPress

text: I want to put the option to share (with share buttons in post footer) but just in some specifics posts, and I want to control this in the admin panel. I know a plugin, but I want do this "without plugin". How can I do this?


title: Date not appearing in custom query

text:
I'm having a weird issue with Wordpress which I cannot solve by myself, and for which I couldn't find an aswer over this and other websites. Basically, I have a custom loop.               while ( $the_query->have_posts() ) : $the_query->the_post(); ?>     <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to    <?php the_title_attribute(); ?>">     <?php the_post_thumbnail('featured'); ?>

<?php the_date('d.m.Y'); ?>

<?php    the_title(); ?>

     <?php endwhile; ?>     <? wp_reset_postdata(); ?>      If I then create another custom query similar to this one, or even if i just duplicate this query further down my page, I don't get the php the_date to return any value! this is the strangest thing... what am I doing wrong?


title: 2 custom post type paging in 1 custom taxonomy

text: I have 1 important taxonomy that contains 2 different custom post type content. I want somehow show them in same taxonomy page with both paging. Well.. i am not sure i can do that or not. Is it possible to paging 2 different CPT in same taxonomy?


title: Add filter 'wpautop' to meta box textarea

text: I'm using -this tutorial- to add simple meta boxes to a custom post type. But the textarea meta boxes are spitting out content all as one big paragraph, with no `<p>` formatting applied. What code would add the -wpautop filter- to the meta box textarea? Thanks for any help.


title: Creating on-page options for Custom Post Type

text: I'm creating a plugin for creating Landing Pages. I use custom post type and custom fields for the landing pages, but i need to add some on-page options for each entry. For example i need to have a an option(check box) for hiding the header(header is edited through a WYSIWYG custom field) on a specific landing page. I searched for different option "frameworks" and i found Redux ( https://github.com/ghost1227/Redux-Framework ) that works for plugins and also uses WordPress Settings API. The examples of Redux and any other framework i found as well as any tutorials i found online about creating settings/options pages are for general options but i need to have those options in the editing screen of my specific custom post type. I'm not a PHP guru but i'm trying and willing to learn, any help will be appreciated or at least if someone can point me to the right direction it would be nice. Cheers, Stelios


title: Replace the attribute_escape to esc_attr()

text:
I opened a similar topic, but since it is a little confusing, I decided to create a new topic to clarify more. i run the website and i found the errors seems like: `Notice: attribute_escape is deprecated since version 2.8! Use esc_attr() instead. in C:\xampp\htdocs\website\wp-includes\functions.php on line 2638` I search and i found some useful information like : When do I need to use esc_attr when using WordPress internal functions , but sorry i am not undearstand.. The errors are in the post title. for example, this is my code of the `index.php`. Where exactly are the errors?               <?php get_header(); ?>

                                  <?php query_posts( 'posts_per_page=6' );?>                       <?php if (have_posts()) : while (have_posts()) : the_post(); ?>                          <div class="post" id="post-<?php the_ID();?>">
<a href="<?php the_permalink() ?>" <?php the_title_attribute(); ?>">                          <?php the_title(); ?>
                                  <?php if(is_sticky()):?>

Welocome

                          <?php endif;?>                                                                                <?php if( in_array( $post->ID, array(354) ) )                                            {echo get_the_content();}                                                else                          {echo get_excerpt();}?>

 <img src="<?php echo get_bloginfo('template_directory'); ?>/images/dots.png" border="0" />

                                        <?php endwhile; ?>                                       <?php else : ?>
 Not found

 Sorry but you are looking for something that isn't here.

                             <?php endif; ?>
     <?php get_sidebar(); ?>     <?php get_footer(); ?>


title: Removing Submenu from Menu

text:
Thesis appears to automatically add the sub-menus (sub-menu ul) to menu parents if childs exists. I have a specific need to remove this html from a particular menu. The menu name is: second_level Not sure if there a hook to do this. I'm trying to remove these from the menu name above.
...
      I'm not trying to remove the class but the UL's.


title: Add plugin by SVN. Current version problem

text: i need add new version of plugin. And i have one problem! On my plugin link http://wordpress.org/plugins/simple- facebook-comments/ i steel see current version 0.7.6 but i add 0.7.7 Look on this skrin http://szymoon.nazwa.pl/images/verssionscrin.jpg I don't now why but version 0.7.7 is not current version why?


title: Transfer comments from one domain to another

text: We have two domains with separate WP installs, it's not a multisite network. We would like to send or transfer comments from domain A to domain B so domain B handles all moderation because we'd like to minimize maintenance as much as possible and domain B is the main site that receives the most traffic within our network. Is it possible to send or transfer comments to the admin backend for moderation between two domains? Thanks in advance!


title: How to add meta slider lite or other slider to main page header in pinboard theme

text: Slider is created using Meta Slider Lite v2.2.1. Meta Slider shows it usage as               Shortcode           [metaslider id=449]          Template Include           <?php echo do_shortcode("[metaslider id=449]"); ?>      Pinboard theme is used. Text module is added to its header element. Text element contains               [metaslider id=449]     <?php echo do_shortcode("[metaslider id=449]"); ?>      slider does not appear. View source shows that               [metaslider id=449]     <?php echo do_shortcode("[metaslider id=449]"); ?>      are rendered literally. How to show slider in header ?


title: Loop through child images of a parent for a Nivo Slider

text: I want to use a Nivo slider to cycle through the children of a parent page one by one, how can I do that? I have the following piece of code that grabs **ALL** the children of a parent page and displays them:               <?php $pages = get_pages(array('child_of' => $post->ID));     foreach($pages as $post)     {     setup_postdata($post);     $fields = get_fields(); ?>         <?php echo $fields->title; ?>     <?php } wp_reset_query(); ?>      Is there a way to show 1 child image and upon clicking the next arrow on the Nivo it shows the next child image?


title: Display posts of custom type in hierarchical order

text:
I has custom field 'People' and I have parent pages(post types) and child pages (post types). This is my code:               <?php       $args = array(      'post_type'=> 'people',     'posts_per_page' => -1,     );     $loop = new WP_Query( $args );         while ( $loop->have_posts() ) { ?>         <?php $loop->the_post();?>
                  <a href="<?php the_permalink();?>" title="<?php the_title(); ?>"><?php the_title(); ?>
     <?php } ?>      I need display this custom post types in hierarchical order. For example:               First parent post type        - first child of first parent post type        -second child of first parent post type     Second parent post type        -first child of second parent post type      But by default this posts displayed in other by time of publish. Any ideas, how resolved this problem? Thanks all.