title: How to list 2 taxonomy terms for a post, based on their hierarchy

text: I'm using get_the_terms to display 2 terms on a post, associated with the taxonomy "location". The terms are the suburb and the city. The location taxonomy is hierarchical so the suburb is a child of the city. In the post edit screen a user selects their city, followed by their suburb (which lists the suburbs based on the city they pick). Both are selectable from drop down menus. My problem is that when the terms are outputted onto the post, it lists them alphabetically, and in some instances the City will be listed first:               Alpha (City), Beta (Suburb)       I need them to reflect their Hierarchy so they are always listed by Suburb first, then city.               Beta (Suburb), Alpha, (City)      Here is my code.               <?php     $terms = get_the_terms ($post->id, 'location');          if ( !is_wp_error($terms)) : ?>          <li id="location">          <?php unset($locations);     foreach ($terms as $term) {         $locations[] = $term->name;         }          $location = join(", ", $locations);     ?>          <?php echo $location; ?>          </li>     <?php endif ?>      Would this be better achieved with wp_list_categories somehow? It seems there is an option "hierarchical" but unsure on how to use it so it just grabs the post's terms and not everything


title: Order of stylesheets in child theme

text: Parent theme has following code for including styles.               function blue_planet_scripts() {         wp_enqueue_style( 'blue-planet-style', get_stylesheet_uri() );         wp_enqueue_style( 'blue-planet-style-bootstrap', get_template_directory_uri().'/css/bootstrap.min.css', false ,'3.0.0' );         wp_enqueue_style( 'blue-planet-style-responsive', get_template_directory_uri().'/css/responsive.css', false ,'' );      }     add_action( 'wp_enqueue_scripts', 'blue_planet_scripts' );      In child theme I just imported parent theme's styles using `@import url("../blue-planet/style.css");` But order of stylesheets are:   * style.css (child theme)   * bootstrap.min.css   * responsive.css  What modification is needed in parent function to include child theme's style.css in last in the order? I need:   * bootstrap.min.css   * responsive.css    * style.css (child theme)


title: How to extract URLs from wordpress taxonomies

text: I am in quite a trouble. I need to extract all possible url from my wordpress blog be it of post, tag, category or anything else after **domian- name.tld/***. I tried my hand on few available codes and plugins but none worked for me. This code works fine but extracts only post URL's i need rest too. I will be really thankful, if somebody could help me out on it.               <?php          include "wp-load.php";          $posts = new WP_Query('post_type=any&posts_per_page=-1&post_status=publish');     $posts = $posts->posts;     /*     global $wpdb;     $posts = $wpdb->get_results("         SELECT ID,post_type,post_title         FROM {$wpdb->posts}         WHERE post_status<>'auto-draft' AND post_type NOT IN ('revision','nav_menu_item')     ");     */          header('Content-type:text/plain');     foreach($posts as $post) {         switch ($post->post_type) {             case 'revision':             case 'nav_menu_item':                 break;             case 'page':                 $permalink = get_page_link($post->ID);                 break;             case 'post':                 $permalink = get_permalink($post->ID);                 break;             case 'attachment':                 $permalink = get_attachment_link($post->ID);                 break;             default:                 $permalink = get_post_permalink($post->ID);                 break;         }         echo "\n{$post->post_type}\t{$permalink}\t{$post->post_title}";     }


title: Ask for template when adding a new page

text: I would ask the admin which template they would like to user when they click on "Add New" Page. Is this possible? I think I have seen something similar before where it ask you how many columns you would like. I'm assuming it's a hook. Does anyone know any resources I can have a look at. Thanks * * * ## EDIT   1. Click on Pages > Add New   2. Modal type window will pop up with the options to select page type (These are just page templates ) eg; Default, Contact, 2 columns, etc   3. Select


title: Login redirect loop after giving Wordpress its own directory

text: I did the instructions here http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory. I have my current site at 'wordpress.mysite.com' and wanted just 'mysite.com'. It worked great. The only problem is now any kind of private site plugin causes me to have a login loop. I enter the right credentials and it asks me to login again and again. Anyone know how to solve this or how to make my site private if these plugins aren't good for a site where wordpress isn't in the root folder?


title: How to seamlessly redirect between different archive and singular slugs?

text: I have a CPT with slug `function` (singular) and archive slug `functions` (plural). Permalink structure for:   * singular is `/function/[postname]/`   * archive is `/functions/[page-x/]`. (can poke live at QueryPosts ) This works and looks fine, however I have logged some cases when people manipulate URL directly, like:   * `/functions/[postname]` (typing name after archive page)   * `/function/` (erasing function name) While this is not complicated to correct with some code explicitly, there would be more post types and it seems like data and logic are quite sufficient for generic solution (really I kinda expected WP to handle it, it does quite a lot to correct link issues). However I have deep WP rewrite traumas and could use some pointers. :) ### To sum it up: > How-To catch and redirect URLs that are correct, other than **wrongly using > archive slug instead of singular and vice versa?** Archive setup is registered like this:               'has_archive' => 'functions',     'rewrite'     => array(         'feeds'      => false,         'with_front' => false,     ),


title: Google Analytics post views in WordPress?

text: Does anyone know of a wordpress plugin or widget that uses Google Analytics to display the page views to the user of the page they are on? The reason it need to integrate with google analytics is that I have page views from existing posts that I wish to be counted and the normal page view plugins don't show the historical views.


title: Rename the insert button in media upload window

text: I have several different posts type, each with a media upload. What I want to do is to rename the "insert into post" button so it correlates to the individual custom-posts. For example - custom post type - "award" and then the media upload box would have the following button, "insert into award". Any ideas?


title: Caching RSS plugin data

text: I'm developing plugin and I need it's data to be cached, let's assume that it's large RSS feed grabber.   Basically data of one RSS feed is about 100 lines of parsed HTML code (about 2KB). On one page there can be from 1 to 5 RSS feeds. My question is, what is the best to cache and store this? Should I use transients? Or just save data to custom created database table? Or create "RSS feed" custom post type? Plugin data is not attached to post. Thank you.


title: Plugin suggestion: Find broken links

text: I recently changed a few categories, so I know I have a bunch of broken links now. Instead of spending hours going through previous posts and fix them manually, I want to use a plugin that can do that for me. My friend Google told me about the "Broken Link Checker" plugin which seems to be quite popular, but for whatever reason it doesn't work for me not matter what I try. I tried to find another similar plugin, but thus far without success. Do you know of any other plugins that basically do the same as the "Broken Link Checker", but might work for my installation? Thanks a lot in advance.


title: How do I override part of the main loop in my child theme?

text:
I have a child theme based on the twenty ten theme which I am happy with except for one thing. My gallery posts (I am a photographer so the goal of my blog is pictures) do not show any images from the post on the main page. I want to have my main page be a list of recent gallery posts each of which should show the shortened version of the description with a preview image (first image from the posted gallery). I am using NextGen Gallery and slim box to display my images - if that makes a difference. I have found the place where the main loop creates the entry for each post on the main page:                   <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
                 <?php the_excerpt(); ?>
     <?php else : ?>
                 <?php the_content( __( 'Continue reading →', 'twentyten' ) ); ?>                 <?php wp_link_pages( array( 'before' => '
' . __( 'Pages:', 'twentyten' ), 'after' => '
' ) ); ?>
     <?php endif; ?>      So, what I need to do is one of the following:   1. Override `the_content` method to include my gallery's preview image along with what the theme does already.   2. Override part of the main loop above to add an image after the call to `the_content` and before the call to `wp_link_pages`.   3. Override the whole main loop to do the same. I feel like I am missing something obvious because I see serious down sides to all three options I can come up with:   1. I do not see any reference to overriding functions like `the_content` and even if I could I want to add to it not replace it. Is there even away to call the original method's functionality after you override a method?   2. As far as I can see there is no way to override part of a loop - its all or nothing.   3. Which leads me to 3 - replacing the main loop. At that point I have to seriously wonder if it is worth having a child theme if I replace the main loop. That's a lot of code that I don't need to own that I would end up owning. Is there an obvious way to do this that I am missing?


title: Help in query for list links

text: How to make one query for display a list of links like this:   Date 05/20/2012   Category - Link   Category - Link   Category - Link   Category - Link   Category - Link   Date 05/19/2012   Category - Link   Category - Link   Category - Link   Category - Link   Category - Link ....


title: query_posts() - problem with "s" parameter

text: I'm trying to create a search page for a custom post type. This is the code I'm using:               $s = $_GET['s'];     $args = array(             'post_type' => 'companies',             's'         => $s     );     query_posts($args);          if ( have_posts() ) :     ....results.....     endif      The problem is that adding the "s" parameter in query_posts() gives me zero results no matter what the "s" value is. It seems like the whole search mechanism is not working at all. Any suggestions?


title: Add Filter to Ignore a Post/Page or a Number of Post/Pages

text: Hoping someone can assist but as part of normal WordPress theme searching, how can I add a filter as part of the search to not include certain posts/pages as part of my LOOP? For example, I want the "Search" to ignore post=234 as part of the loop or posts 123,234,555? Thanks.


title: <form> inside a metabox

text: I'm trying to write a plugin that allows a user to upload a video to Vimeo through the Vimeo upload API. In order to avoid trying to upload a video to a potentially shared hosting account and then from there to Vimeo I am trying to upload directly to Vimeo through their POST availability - https://developer.vimeo.com/apis/advanced/upload#post To do this I have to place a form inside of a meta box for a custom post type called 'Vimeo' but wordPress is filtering the tag and it's attributes from the returned HTML source. Is there a way of preventing this or have I taken the wrong approach? I believe I may have a form within a form situation . Thanks.


title: Any way to use a custom Parameter for vimeo embed without using an iframe?

text: I am trying to get some oembed parameters attached to my Vimeo clips. I tried to get it going using the following two instructions:   * Passing Parameters to a Vimeo link in a WordPress Custom Field \- LimeCanvas.com   * Any way to use a custom parameter for YouTube embed without using an iframe \- WordPress.SE.com Unfortunately what works for YouTube won't work for Vimeo, as the returning URL has no such string as `?feature=oembed` that I can make `str_replace` work on. It is just the video's id at the end of the URL, which is random. I can make it work if I enter the exact ID of the clip to make `str_replace` look for. Any idea how to make the function look for numbers and attach the parameters? An example clip would be               http://vimeo.com/14956293      and the oEmbed should be               //player.vimeo.com/video/14956293?color=FFFFFF&title=0&byline=0.       As you can see here, there is another difference to YouTube. The arguments start with? and connects the arguments with `&`. Whereas YouTube begins with `&` and also connects the arguments with `&`.


title: Two separate portfolio pages

text: Is it possible to have two different portfolio pages with different items in each one? I use a free theme called ADAPT, and I have two "portfolio template" pages, NEW vehicles and USED vehicles. An excavator or a tractor may be NEW or USED and have the same category (excavator or tractor). I'm having an issue where USED equipment is showing up in the NEW page. What method should I use to restrict only specific categories to specific pages?


title: Gravity Forms Shortcodes not working on pages child pages

text: Am using gravity forms and am implementing on pages using shortcodes. I upgraded to the latest versions of both WP and GF and the forms stopped showing up for child pages, ie pages that have a parent page. Any ideas?


title: Quicktag insert multiple lines

text:
I use the Editor Quicktag Buttons to store special things like this example below is used to store the DIV's to make Columns on my theme. I need help, I want to modify the snippet below so that it will insert the HTML onto multiple lines, so instead of adding
1st
n/
2nd
n\

      To the textarea as one Line, I would like to insert it as 3 lines like this...
1st

2nd

      Here is the code I use to add this button...               QTags.addButton( 'columns', 'Columns', '
1st
n/
2nd
n\

', '' );


title: How to filter terms from a custom taxonomy by a usermeta value on all screens and templates

text: I have a custom taxonomy "q_client" - each time a new term is added to this tax the ID of the user is stored in user_meta. So each user has an array of id of the terms they have added - a quick hack to get around the lack of a taxonomy_meta table. So - I'd like to use pre_get_posts to only include the terms that this user has added on ALL views - admin and front-end. Here is what I've got so far: Add the action:               add_action( 'pre_get_posts', array ( $this, 'tax_query' ), 2 );      The method               public function tax_query( $query )      {                  // get our existing user meta - or an empty array ##             $q_client_terms = $this->get_q_client_terms();                  wp_die(var_dump($query));                  if ( $query->is_tax( 'q_client' ) ) {                      wp_die(var_dump($q_client_terms));                      $taxquery = array(                     array(                         'taxonomy'  => 'q_client',                         'field'     => 'id',                         'terms'     => $q_client_terms,                         'operator'  => 'IN'                     )                 );                      $query->set( 'tax_query', $taxquery );                 return $query;                  }          }      The main problem is I can't get is_tax or any other query variable to catch correctly - var_dump($query) gives a boolean false on is_tax() - it does not even know which post type this is on when editing the taxonomy via the admin. Any help would be much appreciated - thanks! **EDIT** Thanks to @Milo - here is the code I now use:                  function get_terms_args( $args, $taxonomies ) {                  global $pagenow; // required if you want to only filter on certain pages ##                  if(                  //is_admin()                 //&& 'edit-tags.php' == $pagenow                 //&&                  'q_client' == $taxonomies[0]              ) {                      // get our existing user meta - or array ( -1 ) to exclude all terms ##                 $q_client_terms = $this->get_q_client_terms();                      // add array of terms to the include key ##                 $args['include'] = $q_client_terms;                   }                  // kick back args Array ##             return $args;              }      One thing to note is that if each user has not added any terms and your return an empty array or an array( 0 ) - they will be shown all the terms - so use array( -1 ) to ensure they are all hidden I've used this filter on all requests to this taxonomy as I want to filter everywhere - not just the admin


title: How to check for specific meta box value on front end and output accordingly

text:
I have a custom meta box with two different radio buttons that can be selected. One is for displaying the content in a "large' format, the other is for displaying content in a "small" format on the front end. I already know how to retrieve a meta box's data and output it, but not how to "check" what specific data has been selected, and how to that output according to what value has been selected. ( **It should be noted that I will be using this data to output a specific CSS class that can then be applied to a different block of code designated for that selection** ) Here is what i have for my meta box (UPDATED):                 <?php     // Register Custom Post Type Meta Box for EPR Music Releases CPT -- Album Sizes     add_action( 'add_meta_boxes', 'musicreleases_albumsize_meta_box_add' );     function musicreleases_albumsize_meta_box_add()     {         add_meta_box( 'musicreleases_albumsize_meta_id', 'Album Size', 'musicreleases_albumsize_meta_box_cb', 'eprmusicrelease', 'normal', 'low' );     }          function musicreleases_albumsize_meta_box_cb( $post )     {         $value = get_post_meta( $post->ID,'meta_box_musicreleases_albumsize',true );         wp_nonce_field( 'my_meta_box_nonce', 'meta_box_nonce' );         ?>
             <input type="radio" name="albumsize" value="album_small" <?php echo ($value == 'album_small')? 'checked="checked"':''; ?>/> Small
             <input type="radio" name="albumsize" value="album_large" <?php echo ($value == 'album_large')? 'checked="checked"':''; ?>/> Large

         <?php        }          add_action( 'save_post', 'musicreleases_albumsize_meta_box_save' );     function musicreleases_albumsize_meta_box_save( $post_id ){         if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;         if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'my_meta_box_nonce' ) ) return;         if( !current_user_can( 'edit_post' ) ) return;              //accepted values whitelist         $allowed = array('album_small','album_large');              if( isset( $_POST['albumsize'] )  && in_array($_POST['albumsize'], $allowed))             update_post_meta( $post_id, 'meta_box_musicreleases_albumsize',  $_POST['albumsize'] );     }     ?>      ...As you can see, the meta box allows the user to select whether the album is to be displayed as a LARGE or SMALL release. **This is my current template which I need to add this data to for the front end (UPDATED):**               <?php     /*     Template Name: Music Releases     */     ?>

Releases
              <?php $music_releases = new WP_Query(array('post_type' => 'eprmusicrelease')); ?>         <?php if($music_releases->have_posts()): while ($music_releases->have_posts() ) : $music_releases->the_post(); ?>                  <?php if($album_url = get_post_meta($post->ID, 'meta_box_musicreleases_url', true)): ?>                      <?php $album_size = get_post_meta( $post->ID,'meta_box_musicreleases_albumsize',true ); ?>                 <?php if($album_size == 'album_small'): ?>
                             <a href="<?php echo esc_url($album_url); ?>" title="<?php the_title_attribute(); ?>" target="_blank">                             <?php if($url_type = get_post_meta($post->ID, 'meta_box_musicreleases_linktype', true)): ?>                                 <div class="<?php echo ($url_type); ?>">
                             <?php else: ?>                             <?php endif; ?>                             <?php the_post_thumbnail('music-release-img-sm'); ?>
                      <?php elseif($album_size == 'album_large'): ?>
                         <a href="<?php echo esc_url($album_url); ?>" title="<?php the_title_attribute(); ?>" target="_blank">                         <?php if($url_type = get_post_meta($post->ID, 'meta_box_musicreleases_linktype', true)): ?>                             <div class="<?php echo ($url_type); ?>">
                         <?php else: ?>                         <?php endif; ?>                         <?php the_post_thumbnail('music-release-img-lrg'); ?>
                      <?php else: ?>
                         <a href="<?php echo esc_url($album_url); ?>" title="<?php the_title_attribute(); ?>" target="_blank">                         <?php if($url_type = get_post_meta($post->ID, 'meta_box_musicreleases_linktype', true)): ?>                             <div class="<?php echo ($url_type); ?>">
                         <?php else: ?>                         <?php endif; ?>                         <?php the_post_thumbnail('music-release-img-lrg'); ?>
                      <?php endif; ?>                  <?php else: ?>                      <?php $album_size = get_post_meta( $post->ID,'meta_box_musicreleases_albumsize',true ); ?>                 <?php if($album_size == 'album_small'): ?>
                             <?php if($url_type = get_post_meta($post->ID, 'meta_box_musicreleases_linktype', true)): ?>                                 <div class="<?php echo ($url_type); ?>">
                             <?php else: ?>                             <?php endif; ?>                             <?php the_post_thumbnail('music-release-img-sm'); ?>
                      <?php elseif($album_size == 'album_large'): ?>
                         <?php if($url_type = get_post_meta($post->ID, 'meta_box_musicreleases_linktype', true)): ?>                             <div class="<?php echo ($url_type); ?>">
                         <?php else: ?>                         <?php endif; ?>                         <?php the_post_thumbnail('music-release-img-lrg'); ?>
                      <?php else: ?>
                         <?php if($url_type = get_post_meta($post->ID, 'meta_box_musicreleases_linktype', true)): ?>                             <div class="<?php echo ($url_type); ?>">
                         <?php else: ?>                         <?php endif; ?>                         <?php the_post_thumbnail('music-release-img-lrg'); ?>
                      <?php endif; ?>                  <?php endif; ?>              <?php endwhile; else: // NO POSTS // ?>          <?php endif; ?>         <?php wp_reset_query(); ?>


title: Create custom 'page' with plugin

text: I haven't been able to find this anywhere else so I thought I'll ask here! My plugin creates a custom post type with the various front-end rewrites, and I'd like to create a page on the front-end that is populated by my plugin based off that CPT - not an actual WordPress 'page' per se. So if a user visited: www.example.com/mycustomposttype/new They would see a webpage generated by my plugin. There will be no Page called 'New' listed in the WordPress Pages.


title: Wordpress URL Problems and Layout

text:
Why is that the layout of 2 homepage is different. When i put `http://localhost/mysite/home/` the layout looks ok and the blog list is there.. there's no problem here.. but when i click home it automatically goes to this url ... `http://localhost/mysite/` and the blog post listing is gone ... I created a page called 'Home' and it's using a custom template... and its set as the 'Front Page' located in SETTINGS >> READING here's the code for my custom template ...               <?php /*     Template Name: List BLog     */ ?>     <?php get_header(); ?>     <?php if ( has_post_thumbnail() ) { ?>
       <?php the_post_thumbnail(); ?>
     <?php } ?>

     <?php genesis_before_content_sidebar_wrap(); ?>
       <?php genesis_before_content(); ?>
         <?php genesis_before_loop(); ?>         <?php query_posts( $args );  ?>         <?php if (have_posts()) : while (have_posts()) : the_post(); ?>         <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>">             <?php the_title(); ?>

 Posted in:             <?php the_category(', ') ?>             |             <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>

             <?php the_excerpt(); ?>

         <?php endwhile; ?>         <?php else : ?>
Not Found
         <?php endif; ?>         <?php genesis_after_loop(); ?>
              <?php genesis_after_content(); ?>
          <?php genesis_after_content_sidebar_wrap(); ?>     <?php get_footer(); ?>      I'm not sure what's happening. Help..


title: How to make a meta box?

text: I really need some help with this because I totally stumped. I'd like to make a metabox with a name and a url input on my custom post type. I want the result to show up in my content on my post. I have a movie review site. So for example I want it to look like this: Mission Impossible 5 (2012) Ethan Hunt is at it again, but this time it personal. The evil meta box code is stopping him from building his site! Youtube Link: youtube.com/blahblah So if anyone can help that would really be great because this is just beyond my comprehension.


title: Count singular post views automatically

text: I'm trying to add some function to each loop called in the themes. What I'm doing is I add a function to count post view from here post views without plugin, to use the function I need to add this line `<?php setPostViews(get_the_ID()); ?>` to `single.php`, `page.php`, etc. I want to know whether I can use some hook to automatically add the `<?php setPostViews(get_the_ID()); ?>` line without hard code it for each `single.php`, `page.php` files.


title: I can't connect my custom jquery to wp admin

text:
I am trying to figure out how to link a custom jquery to my custom meta box created in wordpress custom post type but I can't find it working. What I want to do is add a line of text when the button is clicked. But it is only reload the "add new post" page and generating a message "Post updated." after I clicked the button. Here is my code: **File: doubleit.js**               jQuery(document).ready(function($){       $("#btn1").click(function(){         $("p").append(" Appended text.");       });            $("#btn2").click(function(){         $("ol").append("
Appended item
");       });     });      **Register and Enqueue Script**               add_action( 'admin_enqueue_scripts', 'add_mytweetjs' );          function add_mytweetjs() {              wp_deregister_script('jquery');              wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js');              wp_register_script( 'myjquerydoubler', plugins_url( '/js/doubleit.js', __FILE__ ), array( 'jquery' ) );              wp_enqueue_script( 'myjquerydoubler' );     }      **HTML Script On The Custom Meta Box**               echo '
This is a paragraph.
';     echo '
This is another paragraph.
';     echo '
';     echo '
List item 1
';     echo '
List item 2
';     echo '
List item 3
';     echo '
';     echo '<button id="btn1">Append text</button>';     echo '<button id="btn2">Append list items</button>';      May be somebody know where is the fault of my code above. Thanks..


title: Image display from custom field

text:
I am trying to display image from my custom meta box but cant make it: function.php file:               add_action( 'admin_init', 'order_box' );     function order_box() {     add_meta_box( 'meta-box-id', 'My Custom Field', 'my_custom_field', 'post', 'normal', 'high' );     }     function my_custom_field(){      global $post;     $custom = get_post_custom($post->ID);     $order=$custom["order"][0];     $image=$custom["image"][0];     ?>     Put Order:     <input type="text" name="order" value="<?php echo $order; ?>" />     Upload Image:     <input type="file" name="image" />     <?php       }            add_action('save_post', 'save_order');      function save_order(){      global $post;      update_post_meta($post->ID, "order", $_POST["order"]);      update_post_meta($post->ID, "image", $_POST["image"] );      }      my template file where i want display the image:               <?php     while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink();?> ">  <?php the_title(); ?>
     <?php the_content(); ?>     <?php      $custom = get_post_custom($post->ID);     $image=$custom["image"][0];     $order=$custom["order"][0];     echo $order;     ?>     //***  <img src="<?php echo $image; ?>" />      <img src="<?php echo get_post_meta($post->ID,'image',true); ?>"          width=200 height=200 />      endwhile;      here 'order' is displayed nicely but not image. print_r($custom) got something like this:               Array (          [_edit_last] => Array ( [0] => 1 )          [order] => Array ( [0] => 13 )          [image] => Array ( [0] => coffee_star.jpg )      )      someone please help me to display the image in my template page. I am very new to wordpress. Thanks in advance.


title: Custom taxonomy: same terms, but for different years

text: I'm building a directory of people in a boarding house. What I'd like to do, is to be able to assign the following metadata to each person:   1. Room number   2. Parking space number   3. Leadership positions The catch is that each of these are linked to a **specific year** , i.e.:   * In 2010, John Smith lives in Room 2, has parking space 5 and is on the house council.   * In 2011, John Smith lives in Room 42, has parking space 1 and is the house leader. In addition, I need to be able to **view people according to these properties** , i.e. I want to see a list of all "house council" members or all people that have lived in Room 1. My initial idea was to create a custom post type "Residents", with a custom (hierarchical) taxonomy "Metadata", which would have the following terms:   * 2010      * Room        * 40       * 41       * 42       * etc     * Parking space        * 1       * 2       * 3       * etc     * Leadership        * House leader       * House council       * Section monitor   * 2011      * Room        * (as above)     * Parking space        * (as above)     * Leadership        * (as above) While this would allow me to filter residents according to room, parking space and leadership in a **specific** year, I'd like to be able to filter residents by a room number for **all** years, i.e.: instead of viewing all residents that lived in Room 2 in 2010 (which is merely a case of filtering according to 2010 > Room number > 2), I'd like to be able to view all residents that lived in Room 2 over the past 10 years. Is this just a case of finding a sidebar widget that would allow me to select a specific sub-term from multiple parent terms in the "Metadata" taxonomy (e.g. selecting "Room 1" from "2010", "2011", "2012", etc.) or is there a bigger architectural fallacy involved here? Please let me know if I'm unclear on anything. Thanks in advance!


title: Remove default user registration, login and subscriber profiles

text: My website has recently come under attack by a wave of spam user accounts. My website uses a custom login that forces users to use their email address as their username, however the spam users all have regular usernames so I am assuming they are running a script which sends POST requests to `/wp- login.php`. It is not enough to remove this page I need to disable the ability to make user accounts via POST requests to this page as I'm pretty sure the spammers are using software and not hand crafting these accounts. Lastly I need to disable `/wp-admin/profile.php` as I believe they are creating accounts to insert back-links into their profiles. How would I go about doing this?


title: How to change style of Disqus comment count on main page

text: I have recently installed the Disqus comment plugin on my blog and so far so good. I'd like to be able to change the style of the comment count on the main page and I'm not having much luck after some searching. If you visit my blog, http://scotthelme.co.uk, with and without JS enabled you will see what I mean. I would like to change the style for the comment count box so that it matches how it originally was. Can anyone point me in the right direction on what I need to change? Thanks. _Update_ When JS is disabled my comment count looks like this (correct):                    1      When JS is enabled my comment count looks like this:               0 Comments      I'm losing the span that wraps the contents of the anchor tag and need to insert it again.


title: How to use both British and American English?

text: I've taken over a website targeting different markets using five language versions, each is setup as it's own site within a multisite network. The main website mainly targets a British audience and one of the language versions targets an American audience. To get the `lang` right in the html tag, like this `<html <?php language_attributes(); ?>>` I need to set the Site language of each site to the language the site in question is written in, but when I install the en_GB language files the default English option disappears. And according to the WP website there are no en_US language files. How does people usually solve this? While I could, in this case, hardcode the lang-attribute for each site it still raises the question for future use. ETA: based on the code suggested by @toscho below I added this to my functions file. It adds a language to the list, but it won't be saved for some reason. The `$current` parameter still holds the previous parameter.               add_filter('mu_dropdown_languages', 'add_en_us', 10, 3);          function add_en_us( $output, $lang_files, $current ) {         array_unshift(             $output,             '<option value="en_US"' . selected( $current, 'en_US', false ) . '>'             . __( 'American English' ) . "</option>"         );         return $output;     }      Based on time constraints in this project I will try adding empty language files instead, however I would still like to know how to make this work properly.


title: Complicated site setup; previews not working

text: I have a site which is hosted on a linux box (`blog.example.com`). I have a main site which is on a separate windows IIS box using the domain `www.example.com`. I have an IIS rewrite rule which rewrites the URL any visitor requests (e.g. `www.example.com/blog/`) via the main site to the correct location. My wordpress address is set to `blog.example.com` and my site address is set to `www.example.com/blog` Almost everything works as intended; visitors get URLs rewritten correctly, and i can still access the backend via `blog.example.com` The only thing which is not working is previewing posts. When drafting a post and clicking on the preview link it displays the URL as `www.example.com/blog/?p=1000&preview=true` but I get a 404 error. Could anyone shed some light on how to rectify this issue.


title: Removing links from posts in WordPress

text: I have few blogs for some clients. I need to remove links to one of my clients blogs in all posts. Just to be clear I need to remove links and my keyword should stay like it is. I found this plugin, but it removes all links. I need to remove all links just for one client, and links for other clients should stay unchanged. Is there any way using SQL statements? I need solution to recognize link no matter what the keyword is and to remove `href` text leaving keyword unchanged.


title: paginate_links() outputs extra empty pages on custom loop

text: I have a custom loop:               $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $works = new WP_Query('category_name=work&posts_per_page=9&paged=' . $paged);       Pagination outputs 3 pages, on first there are 9 posts, which is also total number of posts, and on pages 2 and 3 there are no posts (there should be no pages if there are no posts on them, right?) Here is my `paginate_links()`:               <?php elseif ( $wp_query->max_num_pages > 1 && ( is_home() || is_archive() || is_search() || is_category() ) ) : // navigation links for home, archive, and search pages ?>              <?php              global $wp_query;              $big = 999999999;              echo paginate_links( array(             'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),             'format' => '?paged=%#%',             'prev_text' => '',             'next_text' => '',             'current' => max( 1, get_query_var('paged') ),             'total' => $wp_query->max_num_pages         ) );              ?>          <?php endif; ?>      On default loop everything is fine.


title: How to custom sort-out editing-panel fields?

text: I'm developing a theme for newspaper. For some new fields like: Top Sub Heading, Bottom Sub Heading, Reporter's Name etc., I implemented custom fields (For a handy use of custom fields, I used the "Advanced Custom Fields" plugin - that's not an issue) So now, for a site editor the WordPress editing fields are like the following images, scattered in different places: ![enter image description here](http://i.stack.imgur.com/D2raU.png) We know the WordPress editing panel is by default like:               <input type="text" name="post_title" size="30" value="" id="title">     <textarea class="wp-editor-area" cols="40" name="content" id="content" aria-hidden="true"></textarea>     <input type="submit" name="publish" id="publish" value="Publish" accesskey="p">      I want to rearrange the input fields in a way that, I can put them in a common place serially like:   1. *Categories `<select><option></option></select>`   2. Top-Sub Title (my custom field input field) `<input type="text"/>`   3. *Post/News Title `<input type="text"/>`   4. Bottom Sub Title (my custom field input field) `<input type="text"/>`   5. Reporter (my custom field input field) `<input type="text"/>`   6. *Post/News Description `<textarea><textarea/>` _               * WordPress default editor fields _ So that it would look like: ![I want to rearrange the editing panel's input fields](http://i.stack.imgur.com/ZCyiZ.jpg) # Is that possible?


title: MetaBox Layout for all users

text: I was wondering : You are an administrator : when you re-order the layout of your meta-box, in a page, or in a post, this layout is saved with your user profil : for example you drag the category box before the publish box... Is it possible to save this layout for other users (editors, authors..) ? Is it possible to organize your layout for every kind of users, without logging with their account ? Thanks for you help !


title: Plugin to Import Dropbox Files into Media Folder from the Cloud

text: I have been reading about options to use Dropbox as your upload folder and moving files to Dropbox from your server to put them in the cloud this way. What I need is a plugin or script to move images from a Dropbox folder to my WordPress' server. This would save me a lot of time as the server is in Europe and I am now located in Asia. There are no such available plugins to my knowledge so one will have to be created. I have found a script I am trying to work with to make this possible. It is one made by Fabi to download and upload files from a Dropbox account to your webserver. I am just not sure yet on the approach I should go for. I could create a plugin options page where you can enter Dropbox data and allow the upload to happen I guess. Never have gone this far in my development though. This will be my first plugin so tips would be welcome. Second is the Dropbox API. It seems I will have to create a Dropbox app here https://www.dropbox.com/developers/apps as well to make the plugin work with Dropbox using OAuth. Other option would be to run the script as is form the server perhaps and make the necessary adjustments using the sample.php file, but the former idea seems cooler. Is there anybody who has worked with the Dropbox api and plugins a lot who could give me some tips or who perhaps has snippets that could be of use? Thanks in advance. Will see what I can achieve in the days ahead and leave updates when I can.


title: Posts not visible on front-end and back-end

text: I have one issue while migrating WordPress to a new server. I am able to see all existing posts in the table. On the admin page if I click _All Posts_ it shows the correct statistics: > All (137) | Published (92) | Drafts (45) But the posts table says _no posts found_. I am able to see categories and pages and all. On front-end the posts are not listed either. What might have gone wrong?


title: switch theme on fly

text: I have two themes: "Default" and "Alternate". I'd like to place a link on my site that says "Switch to Alternate Theme", which will change the default theme to the alternate and vice versa. A cookie would be set to save which theme the user is currently on, so when they return they will see the last theme they selected. How do I change the theme on the fly in wordpress? Thanks!


title: WordPress bug reporting?

text: If you find a WordPress bug, how do you verify that it has been reported and/ or is being worked on for the next release?


How should I use posts_where to change meta_value from a string to integer?


title: Updating my plugin without releasing a new version

text: Is it possible to change a file in wordpress.org repository (using SVN) without incrementing the plugin minor version? Normally, when I change something in my plugin and want to update it in the repository, I need to increment the version and upload the plugin files under /tags folder as a new minor version. This will also send a notification to all plugin users of a new version release. What should be done in order to make a small change in the existing version without incrementing it and without the notification?


title: Wordpress loop in post admin view

text: I'm trying to use the loop inside custom post settings.   However this results in several errors the most common being the following: when I click on a post on the admin it always goes to the the last post. The code that I use is:               $original_query = $wp_query;     $wp_query = null;     $args = array( 'nopaging' => true, 'cat' => $e->cat_ID );     $wp_query = new WP_Query( $args );     while ( $wp_query->have_posts() ) : $wp_query->the_post();        $output .= '<option>'.get_the_title().'</option>';     endwhile;           wp_reset_postdata();     $wp_query = null;     $wp_query = $original_query;      any help would be very much appreciated!!   thanks


title: Post via wp-admin and via iOS app, same hooks and triggers involved?

text: I've got an `add_action` in functions.php, the action is for `save_post` and the function I'm running I've named set_attachment_url. I'm simply getting the first attachment on a post and setting a custom field with the URL of that attachment. Good news is, everything works great when I'm adding content from the wp- admin. But when I add content from the iOS app, I don't get the same results. I have to add the post, tap the post, click "update" and **THEN** it works. I don't know enough about the hooks and when each gets fired, although I'm learning quickly. Can anyone spot what the issue may be, why it's not working from iOS on insert, but on update it will. Here's the basics ...               add_action( 'save_post', 'set_attachment_url', 10, 1 );          // process the attachment url     function set_attachment_url($post_id){              // get the post and status         $my_post = get_post($post_id);         $post_status = $my_post->post_status;              // if we are publishing         if($post_status == 'publish'){                  // check custom field -- this is what tells us if we need to process this photo or not             // if it does not have a photo_url then we need to work on it                  $photo_url = get_post_meta($post_id, 'photo_url', true);                  // if no length, we need to fill it             if(!strlen($photo_url)){                      // get the first attachment for this post                 $args = array( 'post_type' => 'attachment', 'numberposts' => 1, 'post_status' => null, 'post_parent' => $post_id );                  $attachments = get_posts($args);                      // set the attachment ID and get the photo url                 $attachment_id = $attachments[0]->ID;                 $photo_url = wp_get_attachment_url($attachment_id);                      // update the custom field with the image source                 update_post_meta( $post_id, 'photo_url', $photo_url );                      // set the featured image                 update_post_meta( $post_id, '_thumbnail_id', $attachment_id );                  }                             }          }


title: wordpress - modifying template to show more posts

text: i'm getting myself pretty confused. i'm trying to modify a template to show more than one post from the loop. here is the code from the template               <?php $wp_query = new WP_Query(array('cat'=>ot_option('hp_mid_cat'),'showposts'=>ot_option('hp_mid_num'),'paged'=>$paged)); ?>             <?php if($wp_query->have_posts()) : while($wp_query->have_posts()) : $wp_query->the_post(); ?>             <?php global $more; $more = 0; ?>      i can't figure out how to edit this to show more than one post. i tried adding more categories, thinking it was just pulling the most recent from each category, but that didn't change anything. i have tried to take out this block and insert some new code but then i get errors of all sorts.


title: Redirect feed to 404 page

text: I would like to redirect my visitors to my 404 when they visit any feed of my page. Something like this. I would liek to do this without changing the header URL.               function fb_disable_feed() {          // set_404();          }     add_action('do_feed', 'fb_disable_feed', 1);     add_action('do_feed_rdf', 'fb_disable_feed', 1);     add_action('do_feed_rss', 'fb_disable_feed', 1);     add_action('do_feed_rss2', 'fb_disable_feed', 1);     add_action('do_feed_atom', 'fb_disable_feed', 1);      Please help!


title: first instantiated SimplePie object cosumes 5mb?

text: This following lines causes 5mb memory consumption. It appears large to me.               if ( ! class_exists( 'SimplePie' ) ) include_once( ABSPATH . WPINC . '/class-feed.php' );             new SimplePie();      I'm using php 5.2.4, WordPress 3.5.1. With PHP 5.4.3, the memory usage with the above lines becomes 2.25mb. I'd like to know a way to reduce it if there is a workaround.


title: Bulk Attach Or Insert Media To Post Without Opening Post Editor

text: How to create a custom panel inside wp admin dashboard where we can insert media to specified posts in bulk? Here is the illustration: ![enter image description here](http://i.stack.imgur.com/AN9Rn.jpg) As shown on the image above, it list all available media on the left and provide the box where we can insert post id to attach the media to. And we can then bulk insert media to the specified posts by hit the attach buttons after we specified the post id for each listed media. I had spent several days trying to figured out how to do it, had tried some plugins also media library editing, but still can not found the answer.


title: Rollover button doesn't appear in sidebar

text: For some reason, I can't add a PayPal donate button to the sidebar of my website. I've been using CSS to create a rollover effect, and while it's worked on a static page of my site: http://kellygreenproject.com/volunteer-2, the same method doesn't appear to work in the top widget on the right sidebar of the site. ### CSS:               a.paypalButton {         display: block;         width: 207px;         height: 44px;         background-image: url('http://kellygreenproject.com/wp-content/uploads/2013/05/General-Donate.png');     }          a.paypalButton:hover {         background-position: bottom left;     }      ### HTML:               <a class="paypalButton" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YJFFMF5R5TJ9J"> </a>      I even added the button to the bottom of the volunteer page (http://kellygreenproject.com/volunteer-2) and it works there, but just doesn't show up in the sidebar. If I write text between the a tag it places the button as a background, but that's definitely not what I want to do.


title: How to use MarkDown in a custom textarea field?

text: I've created a custom metabox with a textarea in it. How would I go about using Markdown in this textarea? I've seen some WP plugins but they seem to only be for the main editor.


title: Separate Uploads folder on other server

text: Is there a way to separate wp-content/uploads on different server ? I mean if i have two servers. Serv1 and Serv2 . On Serv1 is the wordpress installation and on Serv2 stays only the uploads folder. I try to use ftp like: `define( 'UPLOADS', 'ftp://user:pass@Serv2/wp-content/uploads' );` on Serv1.It works but when you point image on the site the URL is with ftp user and password. So that's unusable. Is there any normal way to do it ? Regards.


title: Mass/Bulk assign categories to posts

text: I need to assign categories to about 200 posts in bulk. Each post would have a few categories. I have the post ID's along with the Category ID's for each post in a text file like this:               Post ID, Category ID, Category ID, Category ID      How could I setup a custom function inside `functions.php` to use `wp_set_post_categories` to do this task? Thanks!


title: Permalinks not working on new site

text: I'm setting up a new site on 3.4.1 and the Permalinks will not work. I have deactivated all plugins and switched to TwentyEleven and they still fail. I can see through outputting $wp_rewrite that the rules are being flushed when I chnage the structure, and .htaccess is being updated, but no matter what I do, I just get a 404 error. I also notice that it doesn't matter what structure I use (excluding default), all links are in the format of the /%postname%/ structure. Any suggestions of what else I can try? Thanks.


Is it possible to allow zip files to be uploaded in Wordpress? I have the following code but it doesn't work.               function custom_upload_mimes($existing_mimes = array()) {          // Add *.EPS files to Media upload         $existing_mimes['eps'] = 'application/postscript';     // Add *.AI files to Media upload         $existing_mimes['ai'] = 'application/postscript';     // Add *.AI files to Media upload         $existing_mimes['3ds'] = 'application/postscript';     // Add *.dwg files to Media upload         $existing_mimes['dwg'] = 'application/acad';     // Add *.dwg files to Media upload         $existing_mimes['dwg'] = 'application/x-acad';     // Add *.dwg files to Media upload         $existing_mimes['dwg'] = 'application/autocad_dwg';     // Add *.dwg files to Media upload         $existing_mimes['dwg'] = 'application/dwg';     // Add *.dwg files to Media upload         $existing_mimes['dwg'] = 'application/x-dwg';     // Add *.dwg files to Media upload         $existing_mimes['dwg'] = 'application/x-autocad';     // Add *.dwg files to Media upload         $existing_mimes['dwg'] = 'drawing/dwg';     //add .zip         $existing_mimes['zip'] = 'application/zip';              return $existing_mimes;     }          add_filter('upload_mimes', 'custom_upload_mimes');


title: how to group custom post types

text: hi wanted to know do i group my custom post types to appear together in a group in the wordpress back end menu bar like this below in the picture what code do i have to use in my functions.php so that i can give my custom post types a nice look and feel http://i39.tinypic.com/281u1og.jpg currently i am using a custom plugin to add functions and it looks like this               <?php     /**      * Plugin Name: Custom Functions      * Plugin URI: http://localhost/      * Description: This is an awesome custom plugin with functionality that I'd like to keep when switching Themes.      * Author: Phantom.omaga      * Version: 0.1.0      */          /* Place custom code below this line. */          add_action( 'init', 'create_post_type' );          function create_post_type() {            /*Custom post type Series has been decleared here*/         register_post_type( 'series',               array(                   'labels' => array(                       'name' => __( 'Series' ),                       'singular_name' => __( 'Series' )                   ),               'public' => true,               'menu_position' => 40,               'rewrite' => array('slug' => 'Series')               )           );          /*Custom post type Episodes has been decleared here*/         register_post_type( 'epsodes',               array(                   'labels' => array(                       'name' => __( 'Episodes' ),                       'singular_name' => __( 'Episode' )                   ),               'public' => true,               'menu_position' => 41,               'rewrite' => array('slug' => 'Episodes')               )           );              /*Custom post type Mirrors has been decleared here*/         register_post_type( 'Mirrors',               array(                   'labels' => array(                       'name' => __( 'Mirrors' ),                       'singular_name' => __( 'Mirror' )                   ),               'public' => true,               'menu_position' => 41,               'rewrite' => array('slug' => 'Mirror')               )           );             }                 /* Place custom code above this line. */     ?>


title: Obtain a list of available translations

text: In answering this question: Change language by clicking a button. It was necessary to obtain a list of languages for which translations were available (i.e. their po/mo files were present in `wp-content/languages`). ## So how can you obtain that list? Clearly by 'available' we can only mean that their `po/mo` files are present - and it's not a concern if every plug-in also provides a translation for that language (interesting to see how you might do this though). The list was originally intended for us in a drop-down, whereby a user could select from a list of (available) languages. So the human readable form of the language _as well_ would be a bonus. But I think this is probably not possible. View the question linked to above for demonstration of the current method used.


title: How do I make specific plugin functionality apply to different sites in a network?

text: I have a site specific plugin that I've written for the main site in my multisite network. Now I realize that the shortcodes that are in the plugin are also useful on the sub-sites, however the sub-sites don't need all the code for custom post types and taxonomies. How do I make just the shortcodes work for sub-sites? Is there a conditional I can use? Here's how my plugin is currently set up:               // Plugin Directory      define( 'CLICK_DIR', dirname( __FILE__ ) );          // General     include_once( CLICK_DIR . '/lib/functions/general.php' );          // Post Types     include_once( CLICK_DIR . '/lib/functions/post-types.php' );          // Taxonomies      include_once( CLICK_DIR . '/lib/functions/taxonomies.php' );          // Shortcodes     include_once( CLICK_DIR . '/lib/functions/shortcodes.php' );


title: Using the_excerpt() on a page

text:
I've been trying to utilize the PHP excerpt function to call from her recent blog post to post on a main landing page without avail. Any thoughts?

Welcome

Welcome to the... .check back shortly for a new selection of oil paintings, latest prints and greeting cards.           <?php      $my_query = new WP_Query('category_name=blog&posts_per_page=1');           while ($my_query->have_posts()) : $my_query->the_post();               $do_not_duplicate = $post->505;         the_excerpt();          endwhile; ?>


title: WordPress network: set themes and plugins for new blog

text: How can I enable specific themes and plugins for new blogs that have been created with `wpmu_create_blog`? I'd like to set the themes and plugins in code rather than having a person manually set them in the network administration section (i.e. not in `http://domain/wp-admin/network/site- themes.php?id=xx`). Thanks! Update: Actually I think I may have figured **part** of this out. `wpmu_create_blog` has a `$meta` property. This property can be set to an associative array with a key of 'allowedthemes'. That key's value should be set to an associative array with keys:values = 'theme-name-or-id':true. I still need to set the starting theme for this blog and set plugins, which must be similar. Is this even a good approach?


title: Second toolbar in tinymce has "display:none" set?

text: I have a plugin that inserts a tinymce like shown below. Something causes the second toolbar, the `theme_advanced_buttons2` to have `display:none` attached to their style attribute, effectively hiding them. I don't manage to find the code responsible for this.               $tinymce =            array     (           'theme_advanced_buttons1' =>                   '                       \                 ,  undo              \                 ,  redo              \                         ...                    ...                      ,  indent            \              '             ,  'theme_advanced_buttons2' =>                   '                       \                    link              \                 ,  unlink            \                         ...                    ...                      ,  help              \              '     );          wp_editor     (           $text        ,  $editor[ 'name' ]        ,  array           (                'tinymce'   => $tinymce              , 'quicktags' => $enabled           )     );      * * * I found the right answer here thanks to a comment by mrwweb: **Show the Kitchen Sink by Default** If you would like to show that second row of options by default, there’s an easy way. Simply put the following into your theme’s functions.php file `(Appearance > Edit > Theme Functions – functions.php)`:               function unhide_kitchensink( $args )     {        $args['wordpress_adv_hidden'] = false;        return $args;     }          add_filter( 'tiny_mce_before_init', 'unhide_kitchensink' );


title: Style Differently Edited Posts

text: Is there any way to add class to edited posts in order to style them differently? If there is a way to do that without adding a class, this option would be much better. EDITED - IGNORE THE ABOVE QUESTION - SEE BELOW Is there a way to add a check box (meta box) in the area that a user writes an article/post so when this is checked a class will be added on the specific post (in loop and in single post page)? If something like this way is impossible, is there a way to get this done with a custom field? If both are possible I would prefer the first way.


title: Correct way to make a title a link

text:
I made the title of my post excerpt a link to the full content. It works but whenever I validate my website, the validator marks it wrong and shows the message below. I've switched around the h2 tags and it still didn't help. **document type does not allow element "h2"** The code looks as shown b elow                                    <a href="<?php echo get_permalink(); ?>">
<?php the_title(); ?>


title: How can I customize wp_footer, where is the code that controls what this function does?

text:
I am using Wordpress 2013 theme as a starting point for a new theme from scratch. Under my themes folder, my footer.php theme looks like this. (Notice the final function`wp_footer()`.
                      <?php get_sidebar( 'main' ); ?>
                 <?php do_action( 'twentythirteen_credits' ); ?>                 <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentythirteen' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentythirteen' ); ?>">. <?php printf( __( 'Proudly powered by %s', 'twentythirteen' ), 'WordPress' ); ?>         .

              <?php wp_footer(); ?>                The problem is that the function `wp_footer()` appears to be including plugins and code that I don't want there. Specifically, the search widget. I reviewed this article. Also the codex, directs me to the directory `wp- includes/general-template.php`, which does not tell me anything about which template tags it might be requiring (I was expecting it would require the search widget). How does one customize the behavior of `wp_footer`? Where (in the file directory) should one look to see what html/php that `wp_footer` is dynamically producing?


title: get_stylesheet_directory() returns wrong URI... localhost/using vhosts

text: I'm trying to develop a WP theme for a client via localhost. I'm using XAMPP on Windows 8 and has set up vhosts to something like myclient.dev. This works for stylesheet               <?= get_stylesheet_uri(); ?>      But when trying to use `get_stylesheet_directory()` (Mainly for images) I get the wrong path: So               <img  class="logo" src="<?= get_stylesheet_directory(); ?>//images/logo.png">      The src returns:               http://myclient.dev/C:/Users/..../Localhost/hfclients.dev/myclient.dev/wp-content/themes/myclient.dev/images/cta-banner.jpg      How can I fix this?


title: Multiple relationships in a query

text: I’m researching a bit WP_Query and me a problem has arisen. I have custom fields in tickets and would like to make a WP_Query showing this (put an example):               (field1 = “data1″ AND field2 = “data2″) OR (field1 = “data2″ AND field2 = “data1″)      To do this I created this query but it returns me well.               'meta_query' => array (         'relation' => 'AND',         array (             'key'     => 'field1',             'value'   => 'data1',             'compare' => '='         ),         array (             'key'     => 'field2',             'value'   => 'data2',             'compare' => '='         ),              'relation' => 'OR',         array (             'relation' => 'AND',             array (                 array (                     'key'     => 'field1',                     'value'   => 'data2',                     'compare' => '='                 ),                 array (                     'key'     => 'field2',                     'value'   => 'data1',                     'compare' => '='                 ),             ),         ),     )      Does anyone know what I'm wrong? I tried different ways but nothing (I put this because it is what I think is the one that comes closest. Greetings and thanks! PD: Sorry for my english! (Google Translate)


title: How to give a File Upload option in wordpress Widget backend?

text: I want to use a file upload Input option where User can upload a Excel file on backend and the widget will save the file in uploads directory and save the file link in the $instance variable of widget. So, that I can use that link to use that excel file to do further work. I don't see any way to save the uploaded file in the instance variable. So, I am looking for some guidelines from the experienced persons. Thanks


title: How to add "time" data this?

text: I am using this simple snippets to get post view count for a long time I was wondering if we can add a "time" data ? Because I would like to show the view of yesterday/ 2 days ago / 2 days ago etc... ? we can display in sidebar like MOST POPULAR POSTS OF THE **DAY** , **MONTH** or **HOURS** (if possible) here is my sidebar code                <?php query_posts('meta_key=post_views_count&orderby=meta_value_num&posts_per_page=4&order=DESC');    if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>      <?php echo getPostViews(get_the_ID()); ?>                 <a class="tab_caption" href="<?php the_permalink(); ?>" title="<?php echo $post_title; ?>"><?php echo get_the_title($post->ID);?>            <?php endwhile; ?>     <?php endif; ?>     <?php wp_reset_query(); ?>


title: Add monthly archives menu and submenu

text: I'm posting this question because I was trying to look for an answer but couldn't find it. I found the answer myself with the help of this answer and I wanted to share it with everybody that would have the same problem. My goal was to create a menu entry called "archives" and pending from it links for the monthly archives of the posts, and of course, that it was updated automatically and automatically translated into the correct language (we are having a three language webpage powered by qTranslate).


title: How can I demonstrate themes well?

text: How can I demo Wordpress themes well? I'd like to avoid any undo labour or inefficiency. Perhaps one Wordpress for links to different themes (`example.com/themes`), and each link goes to a second Wordpress that has as theme-switching plugin installed (`demos.example.com/theme-name`). Or is there another way to allow switching themes _and_ changing the content of the site depending on whether the visitor is on a demo theme or the main gallery/blog section?


title: taxonomy term names in custom post type permalink structure

text: I know there has been a lot of times this question has been asked here before, but no matter what method I have tried from here, nothing seems to be working for me. I guess I am sure I am writing in the write codes, but still this is not working for me. I have a website for pizza delivery, where I want the url structure of locations post type and zip codes taxonomy to always have a base pizza- delivery/state, so the url would look like this..               domain.com/pizza-delivery/state/city/     domain.com/pizza-delivery/state/city/zipcode/     domain.com/pizza-delivery/state/city/zipcode/postname      City is the main taxonomy term name, while zip codes will be the sub terms. I have followed the steps mentioned here How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child- tax/custom-post-type-name but its not working for me at all. Here is the complete code               function location_post_type() {         $labels = array(            'name'               => _x( 'Locations', 'post type general name' ),            'singular_name'      => _x( 'Location', 'post type singular name' ),            'add_new'            => _x( 'Add New', 'location' ),            'add_new_item'       => __( 'Add New Location' ),            'edit_item'          => __( 'Edit Location' ),            'new_item'           => __( 'New Location' ),            'all_items'          => __( 'All Locations' ),            'view_item'          => __( 'View Location' ),            'search_items'       => __( 'Search Locations' ),            'not_found'          => __( 'No Locations found' ),            'not_found_in_trash' => __( 'No Locations found in the Trash' ),             'parent_item_colon'  => '',            'menu_name'          => 'Locations'     );          $args = array(         'labels'        => $labels,         'public'        => true,         'publicly_queryable' => true,         'menu_position' => 5,         'supports'      => array( 'title' ),         'has_archive'   => true,         'hierarchical'  => false,         'query_var'     => true,         'rewrite'       => array( 'slug' => 'pizza-delivery/georgia/%zip_codes%', 'with_front' => false )     );          register_post_type( 'locations', $args );      }          add_action( 'init', 'location_post_type' );                    function zip_code_taxonomy() {            register_taxonomy('zip_codes', 'locations', array(               'hierarchical' => true,          'query_var'    => true,          'labels' => array(              'name' => _x( 'Zip Codes', 'taxonomy general name' ),              'singular_name' => _x( 'Zip Code', 'taxonomy singular name' ),              'search_items' =>  __( 'Search Zip Codes' ),              'all_items' => __( 'All Zip Codes' ),              'parent_item' => __( 'Parent Zip Code' ),              'parent_item_colon' => __( 'Parent Zip Code' ),              'edit_item' => __( 'Edit Zip Code' ),              'update_item' => __( 'Update Zip Code' ),              'add_new_item' => __( 'Add New Zip Code' ),              'new_item_name' => __( 'New Zip Code Name' ),              'menu_name' => __( 'Cities & Zip Codes' ),         ),         'rewrite' => array(              'slug' => 'pizza-delivery/georgia',              'with_front' => false,              'hierarchical' => true         ),       ));     }          add_action( 'init', 'zip_code_taxonomy', 0 );          add_filter('rewrite_rules_array', 'mmp_rewrite_rules');          function mmp_rewrite_rules($rules) {         $newRules  = array();         $newRules['pizza-delivery/georgia/(.+)/(.+)/(.+)/(.+)/?$'] = 'index.php?locations=$matches[4]';         $newRules['pizza-delivery/georgia/(.+)/?$']                = 'index.php?zip_codes=$matches[2]';               return array_merge($newRules, $rules);     }               function filter_post_type_link($link, $post) {         if ($post->post_type != 'locations')             return $link;              if ($cats = get_the_terms($post->ID, 'zip_codes'))         {             $link = str_replace('%zip_codes%', get_taxonomy_parents(array_pop($cats)->term_id, 'zip_codes', false, '/', true), $link); // see custom function defined below         }         return $link;     }          add_filter('post_type_link', 'filter_post_type_link', 10, 2);          function get_taxonomy_parents($id, $taxonomy, $link = false, $separator = '/', $nicename = false, $visited = array()) {             $chain = '';            $parent = &get_term($id, $taxonomy);              if (is_wp_error($parent)) {             return $parent;         }              if ($nicename)                 $name = $parent -> slug;                 else                 $name = $parent -> name;              if ($parent -> parent && ($parent -> parent != $parent -> term_id) && !in_array($parent -> parent, $visited)) {                 $visited[] = $parent -> parent;                 $chain .= get_taxonomy_parents($parent -> parent, $taxonomy, $link, $separator, $nicename, $visited);              }              if ($link) {             // nothing, can't get this working :(         } else             $chain .= $name . $separator;             return $chain;         }      Now the thing here is that when I upload this code, I go to the Permalinks page to refresh the permalinks, but then when I go to any taxonomy term or custom post type url of the concerned, it always gets redirected to the index.php page ? Thanks a lot !


title: Custom post type code hides navigation

text: Hi I have this code for custom post types               add_filter( 'pre_get_posts', 'my_get_posts' );           function my_get_posts( $query ) {     if ( is_home() )         $query->set( 'post_type', array( 'post', 'page', 'album', 'movie', 'quote', 'attachment' ) );          return $query;     }      i added it to my functions.php file, it works but it makes my navigation menu disappear.


title: Showing ads after posts in home page

text:
I am using this code for showing ads after one post in the home page. It's working fine. But I want to show an ad after one post and another one ads after 5 post. What will the loop be. Any suggestions?                 <?php if((have_posts)): ?>       <?php $count=0; ?>       <?php while(have_posts()): the_post(); ?>       <?php $count   ?>       <?php if($count==2): ?>
Ads code here

<a href="<?php the_permalink(); ? >" title="<?php the_title(); ?>"><?php.  the_title(); ?>
          <?php else: ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?>
       <?php endif; ?>       <?php endwhile; ?>       <?php endif; ?>


title: Allow user to input shortcode into wordpress widget

text: This is my first widget, so I'm new to this, but I want the ability to add 6 different shortcodes to the widget that the user can set. The question is this, how do I get the plugin to allow the user to do this and how do I get the plugin to execute the shortcodes?


title: SQL Query to select post title & post ID from a particular category

text: I am looking for SQL query to select post title & post ID from a particular category. I looked at wordpress table structure but it is really confusing me.


title: how to create a custom post?

text: am new to wordpress.I know how to create a custom page using page template.For ex.page-pagename.php or page-id.php/page-06.php. But i Dont know how to create a custom post like above.so please help me.


title: wp-admin url doesn't allow to login and redirects to same page

text: I am using wordpress 3.6, the latest version. In this version when i access login page for admin url like `www.example.com/wp-admin` and i enter user name and password, wordpress redirects me to the same page. But when i try to access using `www.example.com/wp-login.php` then it works perfectly When i try to login using wp-admin i am redirected to `www.example.com/wp- login.php?redirect_to=www.example.com/wp-admin%2F&reauth=1` strange url. I googled it and found interesting thread on wordpress.org http://wordpress.org/support/topic/wp-admin-suddenly-not-working, this thread seems inactive and old. I tried to apply all the suggestion but doesn't work How to fix this issue ? Is there any plugin for that or is there any error in some of the plugins. ? **Update** I am using Subdomains and my site is accessed at www.subdomain.examplesite.com. And i am using windows hosting with IIS server.


title: Storing images on a local site

text: sorry for the elementary question. When I'm building a local site on Wordpress, should I be storing my images in an "img" folder and then using CSS "background-image" to show these photos? That way, when I go live, the image root address won't change. As it stands, I am just uploading each photos and inserting it directly into the post, then styling it with CSS when need be. However, this means I'm getting big, clunky roots that will have to change when I go live (i.e. localhost/corporate/wp-content/uploads/2012/05/1-new.jpeg).


title: Query Posts Incorrectly Displaying Tags Archives

text: When I go to a tag archive ( http://themeforward.com/demo2/tag/n/ for example) ALL the posts on my blog are being displayed, not just the posts with that tag - and I'd like to fix this. Here's my tag map, click any tag and ALL posts are being pulled http://themeforward.com/demo2/templates/547-2/ Here is how I am querying posts (there is custom code for an options panel to display the number of posts assigned):               <?php     $per_page = get_option('to_count_archives');     query_posts("cat=${cat}&posts_per_page=${per_page}&paged=".$paged);     if (have_posts())     ?>     <?php while (have_posts()) : the_post(); ?>


title: get_the_category_list or get_the_tag_list for custom post types and taxonomies?

text: Basically I've setup a custom post type and taxonomy for a set type of posts and I'm creating a child theme from twentyeleven. When I use the default WP Posts and then I tag them and categorize them, get_the_category_list and get_the_tag_list do their work and display below the post. Now I would like to do the same with my custom post type with two taxonomies that behave as tags and categories. Is there a way I can do this without having to redo the work that get_the_category_list and get_the_tag_list already do?


title: How to re-enable the links manager?

text: There is no links manager in the admin_menu of Wordpress 3.5.1 anymore. I'm creating a custom add_links_page, and I'm having a hard time with the making a plugin. Do I need to initialize something to show the links page?


title: Cannot activate Jetpack on my server

text: I'm trying to install Jetpack after a successful install, but Jeckpack throws an error about site not being publicly accessible: > site_inaccessible > > Error Details: The Jetpack server was unable to communicate with your site > [IXR -32300: transport error: http_request_failed Operation timed out after > 15001 milliseconds with 0 bytes received] Been checking Jetpack/WordPress support forums for some options, XMLRPC is enabled > XML-RPC server accepts POST requests only. Trying curl to fetch the data & it's successful in making the connection > curl -i -L --data 'test' 'https://jetpack.wordpress.com/jetpack.register/1' > > HTTP/1.1 400 Bad Request   >  Server: nginx   >  Date: Wed, 14 Dec 2011 13:40:59 GMT   >  Content-Type: application/json   >  Transfer-Encoding: chunked   >  Connection: close   >  Vary: Cookie   >  X-hacker: If you're reading this, you should visit automattic.com/jobs and > apply to join the fun, mention this header.   >  X-Pingback: http://jetpack.wordpress.com/xmlrpc.php   >  Expires: Wed, 11 Jan 1984 05:00:00 GMT   >  Last-Modified: Wed, 14 Dec 2011 13:40:59 GMT   >  Cache-Control: no-cache, must-revalidate, max-age=60   >  Pragma: no-cache I don't use W3 Total Cache plugin, which seems to cause problems with many users. How can I get it to activate? I'm running on WordPress 3.3


title: How to display last 3 posts (recent posts) in a static page?

text: I would like to implement something like "recent posts" in a static page: http://themes.codehunk.me/insignio/ (at the footer) How I would be able to do this without a widget?


title: Creating login session via CURL

text: Using the following code I experienced some problems: Login works but every link in the dashboard I will click will follow into the 404 not found page. It seems that there won't be a working session created?               $username="admin";     $password="admin";     $url="http://www.yourdomain.com/";     $cookie="cookie.txt";          $postdata = "log=". $username ."&pwd=". $password ."&wp-submit=Log%20In&redirect_to=". $url ."wp-admin/&testcookie=1";     $ch = curl_init();     curl_setopt ($ch, CURLOPT_URL, $url . "wp-login.php");     curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);     curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");     curl_setopt ($ch, CURLOPT_TIMEOUT, 60);     curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);     curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);     curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie);     curl_setopt ($ch, CURLOPT_REFERER, $url . "wp-admin/");     curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);     curl_setopt ($ch, CURLOPT_POST, 1);     $result = curl_exec ($ch);     curl_close($ch);     echo $result;     exit;


title: User Profile Avatars

text: I'm using this plugin http://wordpress.org/plugins/user-photo/ How can I get the Profile Photo that I upload through this plugin to show in the All Users list beside the Users Name and in the admin bar? I see the below codein admin-bar.php but so confused               /**      * Add the "My Account" item.      *      * @since 3.3.0      */     function wp_admin_bar_my_account_item( $wp_admin_bar ) {     $user_id      = get_current_user_id();     $current_user = wp_get_current_user();     $profile_url  = get_edit_profile_url( $user_id );          if ( ! $user_id )         return;          $user_info  = get_avatar( $user_id, 64 );     $user_info .= "{$current_user->display_name}";          if ( $current_user->display_name !== $current_user->user_email )         $user_info .= " - {$current_user->user_email}";               $wp_admin_bar->add_menu( array(         'id'        => 'my-account',         'parent'    => 'top-secondary',         'title'     => $user_info,         'meta'      => array(             'class'     => 'ProCorner',             'title'     => __('My FRS ID'),         ),     ) );      }


title: How can I filter into the Wordpress back-end menu builder?

text: I would like to who the categories of custom post types in the wordpress back- end drag-and-drop menu builder. Is there a filter that I could use to add extra bits of markup there? My idea is to add custom data attributes with category names and put them out as a tooltip with Jquery.


title: How to filter the terms to a special custom taxonomy?

text:
I do have a custom taxonomy called "countries". With the code below I get for each term (country) the number of its published posts in brackets, like the following:   * Canada (3)   * USA (5)   * Italy (2)    * Cambodia (4)   * etc. How is it possible to filter these countries to a special continent (e.g. Asia), which I have in another taxonomy called "continent"? Please see below in code as [IF_IN_TAXONOMY 'continents' WITH TERM 'Asia'].               <?php       $terms = get_terms('countries');       if ( !empty( $terms ) && !is_wp_error( $terms ) && [IF_IN_TAXONOMY 'continents' WITH TERM 'Asia']){       echo '
';       foreach ( $terms as $term ) {       $term = sanitize_term( $term, 'countries' );       $term_link = get_term_link( $term, 'countries' );       echo '
' . $term->name . ' ('     .$term->count . ')' . '
';       }       echo '
';      }      ?>       I tried the functions "is term", "has_term", "term_exists" and tried it in a query "if (is_tax( 'continents', 'Asia' )", but nothing is working.


title: the_excerpt function not showing image

text: I am having posts with images.In single post page all contents displaying well with image. But in blog page , the content only displaying not an image. How can i make it to display For example, http://www.beezid.com/blog this blog displaying images with read more link but not in my case http://optisolbusiness.com/gonzobidz/blog/ Thanks in advance !


title: Does a reply to a wordpress comment notify the author of the comment?

text: Currently I have my comments set so that when you hit "reply" to a comment, it will insert `@USERNAME` of the person you are replying to. I am trying to find out if wordpress emails that user to let them know that I have replied to a comment they left or if this is something I will have to manually code in?


title: Set custom field value when reaching expiration date

text: I had the idea to make sticky posts expire after a certain period of time. FYI, I am using a custom post type along with custom field suite and created sticky posts by creating a boolean custom field. `premium` is a true/false custom field which returns the value `1` if the checkbox is checked (which makes a post a featured post) If I created another custom field to set the expiration date, how would I set the sticky-custom-field value to 0 when the expiration date is reached? What I mean is (in written english):   * check for a custom field with the key "premium"   * check if custom field "premium" has value 1   * check for a custom field with the key "expiration_date"   * check if "expiration_date" value is in the past, but not today   * if "expiration_date" is in the past, set "premium" value to 0 Can someone assist making this a function? I'd begin with the following (please excuse the style, I am just trying to provide ideas)               global $post;     global $cfs;     if ( '1' = $cfs->get('premium') && ' ' != $cfs->get('expiration_date') ) :     $current_date = date(Y-m-d);     $expiration_date = $cfs->get('expiration_date');     if( // I'm stuck here... ) ....     date_post_meta( $post->ID, 'premium', '1', '0' ); // set premium field from 1 to 0 for every post that matches     endif;


title: wp_specialchars and wp_specialchars_decode in a shortcode plugin

text: I have written my first plugin, a shortcode plugin. I have read about `wp_specialchars` and `wp_specialchars_decode` but I'm not sure how to use them. The plugin read a shortcode allowing some parameters and it inserts a script in the page html code. For example, `[MYSHORTCODE TITLE="a short title"]` yields the following script code lines:               $html ="<script type=\"text/javascript\">\n"     $html.="var text=\"" . $par['title'] . "\";\n"      I'm not sure if here I need to write:               $html.="var text=\"" . wp_specialchars_decode($par['title']) . "\";\n"      or               $html.="var text=\"" . wp_specialchars($par['title']) . "\";\n"      or neither one nor the other.


title: Using $wpdb to query posts with meta value containing current post_id

text: I am trying to to use $wpdb to retrieve a list of posts from the Database where the meta_value in the wp_postmeta table contains the current post_ID in inverted commas. eg. "10" The inverted commas are the make sure that 10 doesn't also match 100 etc. I can get it work work when I paste the exact of the meta value ie: a:1:{i:0;s:2:"10";}, however it is also returning all the revisions, not just the most recent post. Here is the code I am currently using:                  $id = get_the_ID();        $rows = $wpdb->get_results($wpdb->prepare(                        "                       SELECT *                        FROM wp_postmeta                       WHERE meta_key LIKE %s                           AND meta_value = %s                       ",                       'roles_%_production',                       '%"' . $id . '"%'                   ));                  // loop through the results             if( $rows ) {             ......             }      Any ideas would be greatly appreciated. Thanks


title: How to generate a list of all urls

text:
I'd like to display a list of all Urls of my Wordprees site. I print out a list of all taxonomy terms like this :               <?php     // Get all Post     $html = '
Articles
';     query_posts('&showposts=-1&order=ASC');     while (have_posts()) {         the_post();         ob_start();         the_taxonomies();          $result = ob_get_contents();         ob_end_clean();         $html .=  '' . get_the_title() . '
';         $html .= $result . '

';     };     $html .= '
';     echo $html;     ?>      Does anyone know how I can do to obtain all correct url (permalink) for all   * Tags    * Category   * Taxonomy terms   * Archives   * Author page   * Posts    * Page   * Others ? Thanks in advance for your help.


title: Problem with custom menu links when moving wordpress installation to subdirectory

text: I know there's a ton of posts pertaining to broken links after migrating a wordpress installation, but I haven't been able to find an exact solution to this one. A site I'm working on has the production wordpress installation running woocommerce running in the root (public_html) directory. That's working fine. I also have a second installation, which we use for different testing and development, in the root/dev directory. The /dev directory is where I did all of the initial development, and I migrated those same files and a copy of the database out to the root directory to "launch" the site in the next couple weeks. Now we had to add a Rewrite rule to the .htaccess in the root directory to force an HTTPS URL. We added the following lines: RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://eddiessportstreasures.com/$1 [R,L] The dev site resides in eddiessportstreasures.com/dev, which is username/password protected. The WP URL and Site URL are both set to eddiessportstreasures.com/dev in the admin dashboard. The admin dashboard is working perfectly fine, and all of the woocommerce links are completely fine. It's just that whenever I hover over a link in my custom menu it now shows a link to the page on the production installation - eddiessportstreasures.com/. So, for example, a link to "Baseball Cards" in the custom menu, where the page address is set to "/product-category/cards/baseball-cards", takes me to eddiessportstreasures.com/product-category/cards/baseball-cards instead of eddiessportstreasures.com/**dev/**product-category/cards/baseball-cards. This of course, brings about a 404 error. This is the same for any "hard-coded" links I have - i.e. the custom menu, and a couple other links to pages within the site. Now, I could go through and change all of the link addresses to include "/dev/", but that's over 50 URLs, and it's not a real solution. For the record, I also reset permalinks. Any help would be greatly appreciated.


title: How do I show sticky posts on a static front page that also contains content?

text: In my theme, I'm using `front-page.php` for the static front page. I'm also using a page to store the content on the static front page. The `front- page.php` file is set up to show the content from that page. However, in the `front-page.php` file, I also want to show all of my blog's sticky posts below that content. How would I do that?


title: Compare transient data with a meta box value

text: So I'm not sure what would be the best way to go about this in terms of best practices and optimization. Scenario: I have query that parses an external XML feed and stores the data using the transient API every 24 hours. This is stored in wp_options and the whole feed is stored in the option_value, one of the numerical values in the feed is for "weight". For example here is what the feed looks like for the this value.               <weight type="string"><![CDATA[120]]></weight>      The posts have a meta_box with a key called "meta_weight" with a numerical value. The query compares these 2 values by grabbing the xml as an array and the meta value with something rather simple like: (I have simplified this example, it is working).               $xml_weight = $xml->weight;     $meta_weight = get_post_meta($post->ID, 'meta_weight', true);                      if $xml_weight > $meta_weight { echo "Your heavy";}      Now for the actual question:) This value comparison is just done on the fly with php, I need to store it in the database using just false/true to tally all posts where this value is true. Should I just add this value incrementally using $wpdb class and insert it into wp_postmeta. Or is there some better method to just grab the value out of the DB and compare it to the meta box value for every post? My sql knowledge is very poor.


title: How do you remove slug altogether from custom post type?

text: For a custom post type page I'd like to completely remove the slug so that the URL structure mirrors http://my-domain.com/CPT-title/ or http://my- domain.com/CPT-category/CPT-title . If I set the rewrite parameter to               'rewrite' => array('slug' => '', 'with_front' => false)      Wordpress freaks out and I get 404 on all pages except for the CPT page. If I don't define slug at all, then it defaults to the CPT name.


title: Twitter-like follow system, is there any plugin?

text: I'm running a multi-author wp site and I'm looking for a plugin that adds a "Follow me" button near the author name so the user can follow his favourite author. I need also to display the other users that are are following the author (i.e. "38 people are following Author_name -> click to view users). I know there is buddypress, but I'm looking for something lighter and stand- alone. Thanks


title: Trying to find a way to query post like normal search would do. within search.php page

text: I have a costume search in a site i am making. When a user search a certain term, i want to display category list with a count of how many posts are found with in that category. I thought of a way but i have problems doing it.   1. in search.php in the loop in `have_posts()`, i will add a line that check each post's category and create an array with those categories ... and just +1 each time a certain category repeat itself...... problem with that since pagination is in place, it will only find the categories for the current page while the remaining pages stay unaccounted for. The fix for that is having another wp_query that just use the `s` term. without the pagination. Problem with that is i dont know how to query wp for a certain term like a normal search would do. i though of using `query_posts` somehow but still unclear on how. Thanks in advanced.


title: value of metadata is null wrong use of if statement

text: I'm using the WP-Ratings plugin which uses the Wordpress built in custom fields to save values of ratings. The name of the custom field is `ratings_score`. I want to ask if each post has a specific rating. What I'm doing is inside the loop doing following:               <?php $rating = get_post_meta($post->ID, 'ratings_score', false); ?>           <?php if ( $rating == 2 ) ) { ?>         <script>             console.log("test");         </script>     <?php } ?>      But it does not work. Am I doing it wrong? I also tried to ask `if ( $rating == '2' )` but thats the same issue. There are definately posts which have `2` as value of `ratings_score`


title: How can i remove the icons, or change that icons

text: How can i remove wordpress multi site, or how can i change that icon? http://i39.tinypic.com/6z206a.jpg Thanks in advance


title: Custom permalink with two parameters

text: I am using custom structure for permalink: `/%postname%/%page%/%year%/`. When I navigate to `http://wordpress-serv/projects-teams/designers/19/2013`, it gives me 404 "Page not found". Nonetheless, it is working fine with `http://wordpress-serv/projects- teams/designers/19` (without year) and `get_query_var('page');` is returning `19`. Now, I just need the value of `get_query_var('year')` instead of getting weird 404.. Here is what the .htaccess file looks like:               AddHandler php-stable .php          # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress      Is there any limit for number of parameters that can be set in custom permalinks? Any suggestions, what might be going wrong?


title: Trying to get threaded comments working

text:
I'm making a Wordpress theme from scratch, but I can't seem to get threaded comments working. I've got them enabled through the control panel, but comment_reply_link() doesn't seem to do anything. I've looked at a number of tutorials on threaded comments, but they all seem to want me to create a function containing all my html, when all I want to do is add threaded comments to what I have already. Any idea what I need to do to get this working with what I've got already? Here's my comments.php:               <?php comment_form(); ?>      <?php if (have_comments()) : ?>
          <?php foreach ($comments as $comment) : ?>         <li <?php  comment_class(); ?> id="comment-<?php comment_ID() ?>">         <?php  echo get_avatar( $comment, 32 ); ?>         <?php comment_text()  ?>
<?php comment_type(_x('Comment', 'noun'), __('Trackback'), __('Pingback')); _e(' by ' ); comment_author_link(); ?> - <?php comment_date() ?> @ <a  href="#comment-<?php comment_ID() ?>"><?php comment_time()  ?> <?php edit_comment_link(__("Edit This"), ' |');  ?>
         <?php comment_reply_link(); ?>
          <?php endforeach; ?>
          <?php else : // If there are no comments yet ?>
<?php  _e('No comments yet.'); ?>
     <?php endif; ?>


title: Woocommerce custom emails without header and footer

text:
I'm working on Wordpress / WooCommerce extension plugin to enable Password Reset on the main site (not wp-admin). I want to use standard WooCommerce mailer and email template to send Password Reset Request email with Activation link Email is triggered by function               function send_activation_link() {       global $woocommerce;            if ( 'POST' !== strtoupper( $_SERVER[ 'REQUEST_METHOD' ] ) )         return;            if ( empty( $_POST[ 'action' ] ) || ( 'lost-password' !== $_POST[ 'action' ] ) )          return;            //My other code here....            ob_start();            // Get mail template       woocommerce_get_template('emails/customer-reset-password-link.php', array(         'user_login'    => $user_login,         'blogname'      => $blogname,         'email_heading' => $email_heading,         'key'           => $key       ));            // Get contents       $message = ob_get_clean();            $mailer = $woocommerce->mailer();       $mailer->send( $user_email, $subject, $message);     }     add_action( 'init', 'send_activation_link');      The template `emails/customer-reset-password-link.php`:               <?php     /**      * Password reset email     */     if (!defined('ABSPATH')) exit;      do_action('woocommerce_email_header', $email_heading);      ?>
Message to user
     <?php      do_action('woocommerce_email_footer');      ?>      It works well, but the email isn't wrapped with header and footer, just `Message to user` If I amend `WC_Email` class with a function:               function tb_send_activation_link($user_login, $user_email) {            //My other code here....            ob_start();            // Get mail template       woocommerce_get_template('emails/customer-reset-password-link.php', array(         'user_login'    => $user_login,         'blogname'      => $blogname,         'email_heading' => $email_heading,         'key'           => $key       ));            // Get contents       $message = ob_get_clean();            $this->send( $user_email, $subject, $message, $headers, $attachments );     }      And then change function in my plugin to:               function send_activation_link() {       global $woocommerce;            //My other code here....            $mailer = $woocommerce->mailer();       $mailer->tb_send_activation_link($user_login, $user_email);     }     add_action( 'init', 'send_activation_link');      It sends complete email (wrapped with header and footer). Have no idea what I'm doing wrong and how to send emails from my plugin. Don't really want to change core WooCommerce code and thus would really appreciate any advice how to solve it. In advance, thank you.