Home page not obeying post per page setting on the first page only

I am working on a custom template for my office. I have a static front page and a static home page to display the blog posts. I am having a few minor issues and will have to create a few other questions as I fix each problem... Anyways, this problem is pretty interesting to me. While in development, I have the post per page set to 3 (Settings > Reading). On the blog page (home.php) I do see my latest posts and that's fine. The problem is the home page is showing about 8 blog posts instead of the 3 that it is set to display. I am not doing anything custom with the query and just using the loop to display the post content. The pagination works fine and functions as expected All paginated pages display only 3 posts and they are all the correct posts for each page. The only issue with this is that the home page first shows 8 posts instead of the 3 that is set in the settings. Any help on this is much appreciated. I tried searching and could not find anyone having this issue so sorry if this is a duplicate post and hopefully I can get a push in the right direction. I also checked with the Twenty Eleven theme and the same issue occurs. This is the template I copied some logic from. I disabled all plugins and the issue still exists. The only plugins I was using were the WordPress SEO and WP Lightbox 2. Even after disabling them the issue still occurs. If I increase the posts per page to 15 it shows 17... If I increase it to 6 I show 10. If I increase the number to 7 or 8 I show 11 posts. If I set it to 9 I show 12. 10 shows 13.... 12 shows 14... As you can see very frustrating. The only place where I change the query is on the front page but I doubt that is affecting the home page. I basically do a custom query on the front page to show only the last 6 sticky posts. I make sure the reset the query afterwards to be safe. Still have no clue about why this is happening. This has me going nuts! I have provided my code below: **home.php**               <?php      /*     Template Name: Home Page (Blog Roll)     */     ?>          <?php get_header(); ?>

             <?php             /* Run the loop to output the page.             * If you want to overload this in a child theme then include a file             * called loop-page.php and that will be used instead.             */             get_template_part( 'loop', 'single' );             ?>
                 <?php if (get_next_posts_link()): ?>                 <?php next_posts_link( '« Older posts'); ?>                 <?php                  endif;                 if (get_previous_posts_link()): ?>                 <?php previous_posts_link( 'Newer posts »' ); ?>                 <?php endif; ?>

         <?php get_sidebar(); ?>
     <?php get_footer(); ?>      **loop-single.php**               <?php     /**     * The loop that displays a single post.     *     * The loop displays the posts and the post content. See     * http://codex.wordpress.org/The_Loop to understand it and     * http://codex.wordpress.org/Template_Tags to understand     * the tags used in it.     *     * This can be overridden in child themes with loop-single.php.     *     * @package WordPress     * @subpackage EHRScopev2     */     ?>     <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

                         <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?>
                             <?php ehrscope_posted_on(); ?> | <?php comments_popup_link(); ?>                             <?php                             if (!is_single() && has_excerpt()):                                 the_excerpt();                             else:                                 the_content(__('Continue reading', 'ehrscope') . ': ' . the_title('', '', false) . '');                             endif;                             ?>

                             <?php                             if (is_single()):                                 ehrscope_wp_link_pages();                                 $tags = wp_get_post_tags($post->ID);                                 ?>
<?php ehrscope_show_tags(); ?>
                                 <?php if ($tags): ?>                                     <?php _e('Show Related Posts', 'ehrscope'); ?>                                     <?php                                 endif;                             endif;                             ?>

                  <?php if (is_single()): ?>

                                 <?php if (is_single()): ?>                                     <?php                                     if ($tags):                                         $tag_ids = array();                                         foreach ($tags as $individual_tag) {                                             $tag_ids[] = $individual_tag->term_id;                                         }                                         $args = array(                                             'tag__in' => $tag_ids,                                             'post__not_in' => array($post->ID),                                             'posts_per_page' => 10, // Number of related posts to display.                                             'caller_get_posts' => 1                                         );                                         $my_query = new WP_Query($args);                                         if ($my_query->have_posts()):                                             ?>
<?php _e('Related Posts', 'ehrscope'); ?>

                                                 <?php                                                 while ($my_query->have_posts()) : $my_query->the_post();                                                     ?>
                                                         <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>
                                                         <?php                                                 endwhile;                                                 ?>
                                             <?php                                         endif;                                     endif;                                 endif;                                 ?>

                 <?php             endif;             comments_template('', true);         endwhile;     else:         ?>

                     <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php _e('No Results', 'ehrscope'); ?>

<?php _e('Sorry, no posts matched your criteria.', 'ehrscope'); ?>

     <?php endif; ?>      Contents of `$wp_query`:               Array     (         [page] => 0         [pagename] => blog         [error] =>          [m] => 0         [p] => 0         [post_parent] =>          [subpost] =>          [subpost_id] =>          [attachment] =>          [attachment_id] => 0         [name] =>          [static] =>          [page_id] => 0         [second] =>          [minute] =>          [hour] =>          [day] => 0         [monthnum] => 0         [year] => 0         [w] => 0         [category_name] =>          [tag] =>          [cat] =>          [tag_id] =>          [author_name] =>          [feed] =>          [tb] =>          [paged] => 0         [comments_popup] =>          [meta_key] =>          [meta_value] =>          [preview] =>          [s] =>          [sentence] =>          [fields] =>          [category__in] => Array             (             )              [category__not_in] => Array             (             )              [category__and] => Array             (             )              [post__in] => Array             (             )              [post__not_in] => Array             (             )              [tag__in] => Array             (             )              [tag__not_in] => Array             (             )              [tag__and] => Array             (             )              [tag_slug__in] => Array             (             )              [tag_slug__and] => Array             (             )              [ignore_sticky_posts] =>          [suppress_filters] =>          [cache_results] => 1         [update_post_term_cache] => 1         [update_post_meta_cache] => 1         [post_type] =>          [posts_per_page] => 3         [nopaging] =>          [comments_per_page] => 5         [no_found_rows] =>          [order] => DESC     )


Show custom posts with a specific "custom TAXONOMY slug" on startpage

I am using this code to get all the custom post types shown on the startpage:                   add_action('pre_get_posts','wpse57309_alter_front_page_query');     function wpse57309_alter_front_page_query( $query ){          if( $query->is_main_query() && is_front_page() ){              if( !$query->get('post_type') ){                  //post type is not set, the default will be an array of them:                  $query->set('post_type',array( 'news', 'events', 'tv'));                             }          }     }      But now I want only custom posts with a custom taxonomy "superevent=true". How can I build this!? Thank you! AD


query attachment images … if no attachments -> get attachments of parent page?

I use this to query all attachments of the current page or post I'm on …               $query_images_args = array(         'post_type' => 'attachment',         'post_mime_type' =>'image',         'post_status' => 'inherit',         'posts_per_page' => -1,         'post_parent' => $post->ID //$post->post_parent     );          $attachments = get_children($query_images_args);          if ( empty($attachments) ) {         $query_images_args = array(             'post_type' => 'attachment',             'post_mime_type' =>'image',             'post_status' => 'inherit',             'posts_per_page' => -1,             'post_parent' => $post->post_parent         );     }          $query_images = new WP_Query( $query_images_args );     $images = array();     foreach ( $query_images->posts as $image) {         $images[] = wp_get_attachment_image_src( $image->ID, 'large');     }          foreach ( $images as $image) {         if ( $image[1] >= 1024 )             $large_images[] = $image[0];     }          if ( !empty($large_images) ):      This works perfectly and queries only the images of the current post or page. However I have one additional thing I want this piece of code to do: If a page has no images attached and is a "child-page" of a page that has images attached I want to query the images of the "parent-page". Again: parent-page -> has images attached child-page -> has no images attached -> should query images of the parent-page This could be done with `$post->post_parent`               $query_images_args = array(                 'post_type' => 'attachment',                 'post_mime_type' =>'image',                 'post_status' => 'inherit',                 'posts_per_page' => -1,                 'post_parent' => $post->post_parent             );      However I have no idea how to differentiate between those two cases. If a page has images attached I want my code to be `'post_parent' => $post->ID`, if a page is a child-page and has NO images attached I want the code to be `'post_parent' => $post->post_parent` Any ideas on that?


Update plugin from personal API

I'm developing a wordpress plugin at the moment which I do not want in the Wordpress plugin repository. However I still want to be able to push updates to my costumers from my own API repository. I've been reading quite a bit about this, and one thing that seems to be something about is the `pre_set_site_transient_update_plugins` filter, however I can't find much info about this. I've tried this tutorial (http://konstruktors.com/blog/wordpress/2538-automatic-updates-for-plugins- and-themes-hosted-outside-wordpress-extend/) which I couldn't get working. I can tell from the comments that others can actually get this working with what must be almost the current version of WP (latest response Apr 22). I tried installing the plugin from the site and putting the API folder on a second domain, but the update notification I usually get when an update is available, didn't show anywhere at all. I'm not sure if it is actually possible to have custom plugins run the auto- update from other repositories so I would like to hear if anyone in here has any experience at all with this stuff? The solution in the tutorial seemed to be an easy solution - I wonder if it's somehow possible to do it in a more advanced way? Any help getting this auto-update from my own repository working would be much appreciated! (PS: I'm running WP version 3.1.3)


Custom Post Type - Permalink Problem

I am having a hard time implementing a custom post type correctly. I have searched for a solution for a long time but couldn't find any. Here's what I did:   1. Freshly installed WordPress in my local wamp server (enabled apache rewrite_module first).   2. Using default theme (twenty fourteen). No plugins installed.   3. Changed permalinks to "Post name"   4. In the plugins folder, created a folder named pr_custom_posts and inside that, created a file named pr_custom_posts.php. In the file I created a custom post type. The code is as follows:              /*     * Plugin Name: PR Movies Custom Post     * Plugin URI: http://www.example.com     * Description: Learning Custom Posts     * Author: PR     * Author URI: http://www.example.com     * Version: 1.0     */          class PR_Movies_Custom_Post {          public function __construct() {         $this->register_post_type();         //flush_rewrite_rules();     }          public function register_post_type () {         $args = array(             'labels' => array (                 'name' => 'Movies',                 'singular_name' => 'Movie',                 'add_new' => 'Add New Movie',                 'add_new_item' => 'Add New Movie',                 'edit_item' => 'Edit Movie',                 'new_item' => 'Add New Movie',                 'view_item' => 'View Movie',                 'search_items' => 'Search Movies',                 'not_found' => 'No Movies Found',                 'not_found_in_trash' => 'No Movies Found in Trash'             ),             'query_var' => 'movies',             'rewrite' => array (                 'slug' => 'movies/',                 'with_front'=> false             ),             'public' => true,             'publicly_queryable' => true,             'has_archive' => true,             'menu_position' => 10,             'menu_icon' => admin_url().'/images/media-button-video.gif',             'supports' => array (                 'title',                 'thumbnail',                 'editor'             )         );         register_post_type('pr_movie', $args);         //flush_rewrite_rules();     }     }           add_action('init', function() {     new PR_Movies_Custom_Post();     //flush_rewrite_rules();      });      The Good Thing: The CPT is showing in my admin panel and I can add and view movies there. THE PROBLEM: I cannot preview the movies in the front end (By clicking the "view" in the CPT in admin panel). It shows in the front end only when I set permalink to default (`http://localhost/wp02/?p=123`). What I have tried:   1. Go to permalink, keep permalink settings to "Post name" and Save changes.   2. Use flush_rewrite_rules() in several places (one by one) in my code. Please see the commented out parts in the code above.   3. Created a menu item as: URL: `http://localhost/wp02/movies` Navigation Label: Movies This creates a menu item in the front end but shows "Not Found" when "Movies" link is clicked. This is driving me crazy. Can anyone please help on this? I would really appreciate.


What are best practices for including jquery plugins

I am integrating a wordpress site with another site. The integration consists of a form hosted in wordpress that the user fills out and submits to the other site. I'm using a custom page template which includes several jquery plugins for things like form validation, etc. Currently I'm linking directly to the js files in the template eg.               <script src="/join/js/jquery.validate-1.11.1.min.js"></script>      Is there a recommended directory for storing javascript files like this? Right now they are in a directory I created in the wordpress root. Is there a recommended way to include jquery plugins? What is the advantage of using wp_enqueue_script('jquery.validate....js') instead of linking directly?


Why is my post categories not displaying?

My post categories are empty. When editing or adding a post they are not displayed in the box. On the /wp-admin/edit-tags.php?taxonomy=category page none of the categories are displayed there either. If I attempt to add a category such as News which was previously there, I get the message, "A term with the name provided already exists with this parent." I have verified that indeed the categories still exist in the wp_terms table. I have reinstalled WordPress 3.6.1 and unfortunately this did not fix the issue.


Load custom css after bootstrap

I have this in functions.php. How can I modify it so that my custom css is loaded after bootsrap.min.css?               function register_css() {         wp_register_style( 'bootstrap.min', get_template_directory_uri() . '/css/bootstrap.min.css' );         wp_enqueue_style( 'bootstrap.min' );     }     add_action( 'wp_enqueue_scripts', 'register_css' );      I found this but it doesn't work and I don't know much about php but I think it's missing the wp_register_style part.


How to display usermeta on front end of site

Question: First example: when getting options from the database for a plugin. You'd use `get_option['plugin_optios']`. My question is how do you 'GET' data from another table? Like wp_usemeta. I want to grab the 'usermeta' and display it on the front of the site. How do I do this?


Create a »Nav Menu Link« for my plugin

is it possible to create a »Nav Menu Link« for my plugin? If I navigate to appearance > menus, I can drag pages or articles into the active menu, but how can I make that happen for my custom plugin? Greetings, philipp


Get page content and execute shortcodes on a page

I would like to get show multiple page's content on one page with shortcodes. If I use `return $html;` the shortcodes not working, if I use `return do_shortcode($html);` the shortcode working, but the content of the page dissapear. What is the working solution?               function get_page_func( $atts ){         extract(shortcode_atts( array(             'title' => ''         ), $atts ) );              $page = get_page_by_title($title);              $args = array(             'include' => $page->ID,         );          $pages = get_pages($args);               $html = $pages[0]->post_content;              return do_shortcode($html);     }          add_shortcode( 'get_page', 'get_page_func' );


How to display a widget available for all themes

I have just created my first WordPress widget ("hello world" style) and was able to display it correctly. But what I notice that if I change my theme then my created widget disappears from available widget area in admin panel; though there are many widgets which are always showed regardless of chosen theme (Like Text widget). I want to know how can I make my widget available across all the themes?


Genesis framework : how to display the primary sidebar manually?

I need to display the primary sidebar in my Home.php template. What is the code to achieve this ?


Filtering posts by multiple taxonomies

I have a page on which I want to display all posts of a specific custom post type, let's call it "persons". I want to allow the user to filter all persons by multiple (!) taxonomies: age, city, profession, level of experience. The best way to do that would be via clicking checkboxes and getting the results immediately via ajax without any page reload. I think this is something many Wordpress developers want to realize. Unfortunately, I have not found any suitable tutorial for achieving this. But it must be something easy to do for experienced WordPress developers... Can anyone provide a code template for how to build a filter page for the custom post type described above? I already know how to filter posts by just ONE taxonomy, by jQuery. This is the code I used so far:
                  All cities                          <?php             // Get all terms of a taxonomy             $taxonomy = 'cities';             $terms = get_terms($taxonomy);              if ( $terms && !is_wp_error( $terms ) ) :             foreach ( $terms as $term ) { ?>                 <a href="javascript:void(0);" data-target="<?php echo $term -> slug; ?>"><?php echo $term -> name; ?>              <?php } endif; ?>

                      <?php                   $args= array(                     'post_type' => 'persons',                      'post_status' => 'publish',                     'meta_key' => 'zip',                     'orderby' => 'meta_value_num',                     'order' => 'ASC',                     'posts_per_page' => -1                 );                 query_posts($args);                      if ( have_posts() ) : while ( have_posts() ) : the_post();                           $post_terms = wp_get_post_terms( $post->ID, $taxonomy, array( "fields" => "slugs" ) );                     $post_terms_space_separated = implode(" ", $post_terms);                     ?>                                               <div class="person <?php echo $post_terms_space_separated; ?>">
                                        <?php endwhile; endif; wp_reset_query(); ?>
                     This code works perfectly fine. But my new challenge is filtering persons by more than one taxonomy - not only by the city, but also by the age, profession and level of experience. How do I need to modify my code for achieving this? Achieving this by Ajax would be the preferrable way, of course.


Storing an array using update_metadata

Have a custom taxonomy "guest" with extra fields.                   foreach ($extra_fields as $field => $display) { ?>
         <label for="<?php echo $field;?>"><?php echo $display;?>	         <input type="text" name="<?php echo $field;?>" id="<?php echo $field;?>" />
         <?php            }      There are 10 extra fields per taxonomy. Can I / should I save these as an array so each "guest" has 1 entry in the guestmeta table instead of 10 entries? Retrieval of the data is also a concern.               update_metadata('guest', $term_id, 'guest_meta', array($field1 => $value1, $field2 => $value2));        vs               foreach($extra_fields as $field => $value){       update_metadata('guest', $term_id, $field, $value);  }


Localiztion in javascript

Wordpress currently uses the `gettext` feature which is available in `php` but unfortunately not in `Javascript`.   I have searched this matter on the web and have come up with this trick. But there is a problem as the php file needs to be called through `Wordpress` system for the `gettext` feature to kick in.   I'm wondering if there is any way to call a php file inside Wordpress so we can use the built-in functions and variables?   Or if anyone can come up with a better solution, that'd be super.


Remove tabs from media uploader for a CPT

I use the media uploader in a own meta-box for a custom post type called "premium". The Thickbox opens after a click of the button in the meta-box and files can be uploaded. Now I want to remove the tabs "From URL" and "Library" only when used the uploader in the edit/new-page for the CPT or if possible with the call of the click-event. I have no idea how to resolve. P.S.: I use this js for calling the thickbox and tried to remove a tab via jQuery:               jQuery(document).ready(function() {         jQuery('#pc_extContent_button').click(function() {         formfield = jQuery('#pc_extContent').attr('name');         tbframe_interval = setInterval(function() {             jQuery('#tab-type_url').hide();         }, 2000);         tb_show('', 'media-upload.php?type=file&TB_iframe=true')         return false;     });


Author Page - List of categories plus number of posts in that category

On my author page I currently have a list of categories the author has posted in generated by the following code:               <?php     $categories = $wpdb->get_results("         SELECT DISTINCT(terms.term_id) as ID, terms.name, terms.slug         FROM $wpdb->posts as posts         LEFT JOIN $wpdb->term_relationships as relationships ON posts.ID = relationships.object_ID         LEFT JOIN $wpdb->term_taxonomy as tax ON relationships.term_taxonomy_id = tax.term_taxonomy_id         LEFT JOIN $wpdb->terms as terms ON tax.term_id = terms.term_id         WHERE 1=1 AND (             posts.post_status = 'publish' AND             posts.post_author = $curauth->ID AND             tax.taxonomy = 'category' )         ORDER BY terms.name ASC     ");     $x = 0;     ?>
         <?php foreach($categories as $category) : ?>         <?php if( $x%2 ){ ?>
         <?php } else { ?>
         <?php } ?>             <a href="<?php echo get_category_link( $category->ID ); ?>" title="<?php echo $category->name ?>"><?php echo $category->name ?>
         <?php $x++; endforeach; ?>
       What I'm after doing is to add the number of posts within each category in the foreach loop, next to the category in parentheses. Any idea how would I go about doing so? Thanks!


Cache directory needed for plugin

I'm working on a new plugin, and i need to write a frew cache files somewhere. At first i wanted to create a cache folder inside my plugin with the following .gitignore file in it:               # Ignore everything in this directory     *     # Except this file     !.gitignore      But when i checkout the plugin in a new project, this folder is not writeable. Obivously I do not want the user to go to the commandline and set this folder's permission with _chmod_ (not everyone is able to do this). Does anyone know an alternative location where I can save my cache files? Thanks in advance!


Force home page to be https?

I have a SSL certificate and https plugin which both work fine along with changing the Settings in the Wordpress menu to https but I have to manually enter 'https' to see the Secure version, is there a way to make the home page force, or even better become https?


How to show all posts of the category in wordpress?

I have create a category by using Custom Post Type plugin, and now only the 5 most recent posts of the category are showing.   What I want is to show all posts for the category.   For examle, suppose I have movies category - I want all movies in that category.   What code should I use and where?   I don't know much about the wordpress, so I would appreciate a step by step process.


Wordpress - Display array data of a child

I've used the wordpress plugin - advanced custom field and would like to show an array of a child, here's my code: I'm using this code to show the custom fields data from a specific page ID's children:               <?php $args = array(         'depth'        => 0,         'child_of'     => 411 );     $pages = get_pages(array('child_of'));          foreach($pages as $post)     {     setup_postdata($post);     $fields = get_fields();     if($fields->company_name != "") : ?>
<?php echo $fields->company_name; ?>
     <?php else : ?>     <?php endif; ?>      <?php     }          wp_reset_query();     ?>      This is the code I'm using to show the checkbox data of the page itself (i.e it's not a parent/child):               <?php $catNames = array( 'branding','creative','development','exhibition','packaging','print','seo','social_media','usability','web','advertising','campaign','content','feasibility','publishing','research','strategy');              foreach($catNames as $name){             if(in_array($name, get_field('categories') )){                 echo ''.ucwords($name).'';                    }         }     ?>       I want to combine the two together so underneath the H2 tag in the first code box I want to show the checkbox data of the child, how can this be done? UPDATE: When I add the checkbox code to the child code, I can't get the data to display, it's either blank or has an error. This is the page I'm working on. The first thumbnail has been hardcoded, the second and third thumbnails should pick up the tags with the code above but it doesn't.


How do you install a .MO (language file) to use as part of a theme?

I have my own theme that I've created and I need to support 3 languages. I started by adding the gettext functions to my template _e("string","namespace") etc, generated the po file with Poedit, and then created the .mo file for Spanish (es_ES) My current setup which is not working > **Update** **wp-config.php**               define ('WPLANG', 'es_ES');        **functions.php**               define('TPL_LANGUAGES',TEMPLATEPATH.'/languages/');          function theme_init(){         load_theme_textdomain( 'protoman', TPL_LANGUAGES);     }          add_action('init', 'theme_init');      **languages mo file**               themes/protoman/languages/es_ES.mo      **index.php**

<?php _e('Home', 'protoman'); ?>

<?php _e('Account', 'protoman'); ?>

<?php _e('Shop', 'protoman'); ?>

<?php _e('Corporate', 'protoman'); ?>
      STILL NO LUCK!


**Wordpress how to create grouping like category** As my wordpress site is writing reviews on Television shows, and they have actors and actress. I would like to create a grouping that goes by the actor/actress name. Lets say "Actor Andrew act in TV Superman and TV Spiderman while Actor Milley act in TV Superman and TV Batman" I want link Andrew to Television show "Superman & Spiderman" while Superman itself is a category and Spiderman itself is a category because the posts in Superman like Superman Episode 1, 2 and so on.. Then we post pictures, word and summary per episode. How do I actually create an additional grouping in wordpress that I can contain the actor/actress name and bind it to category(The Television show)


How do I get the child category posts from a custom post type?

I have a Custom Post Type called "Movies" with 2 categories called "Now Showing" (cat id=6), and "Coming Soon" (cat id=7) I am trying to alter the code to only pull in the child category for two separate pages, instead of ALL of the posts within the custom post type. Here is the code I am trying to change: (Any help would be great!)
Now Showing
                      <?php                 $args = array( 'post_type' => 'movies', 'paged'=>$paged );                 $loop = new WP_Query( $args );                 $i = 1;                      while ( $loop->have_posts() ) : $loop->the_post(); ?>                          <?php include( TEMPLATEPATH . '/includes/show-movies.php' ); ?>                      <?php endwhile; ?>


Notice: Undefined index: translations in ..../update.php on line 302

I am getting these error when I move from localhost server to shared server. Any idea on how I can fix this problem?               Warning: Invalid argument supplied for foreach() in /var/www/lawyer/wp-includes/update.php on line 295          Notice: Undefined index: translations in /var/www/lawyer/wp-includes/update.php on line 302          Warning: Invalid argument supplied for foreach() in /var/www/lawyer/wp-includes/update.php on line 295          Notice: Undefined index: translations in /var/www/lawyer/wp-includes/update.php on line 302      I am running wordpress 3.9.2 with Cherry Framework


Override Constants in Child theme

I have a parent theme that declare these constant in `function.php:`               define("THEME_DIR", get_template_directory());     define("THEME_DIR_URI", get_template_directory_uri());     define("THEME_NAME", "BARNELLI");     define("THEME_STYLES", THEME_DIR_URI . "/css");     define("THEME_INCLUDES", THEME_DIR . "/includes");     define("THEME_POST_TYPES", THEME_DIR . "/includes/post-types");     define("THEME_INCLUDES_URI", THEME_DIR_URI . "/includes");     define("THEME_FONTS", THEME_DIR_URI . "/font-awesome");      i need to modify some files included in `includes` directory and copy the directory structure (including files). As i read in Codex Documentation, `function.php` in child theme is loaded before the same file in parent's theme and only the files in the root on the parent theme can be overrode in child theme. If i declare modified constant in child's `function.php` will be overrode by parent's `function.php` and if i copy (and modify) an included file into child theme directory will not work. What do you suggest to solve this problem?


Meta-Box to add multiple items one at a time and on publish save all

My example custom content type is for recipes. There will be a meta-box for ingredients. In this meta-box there will be three attributes and a "add" button.               Name     Measurements     Notes          Add Button      **My question:** If There are multiple ingredients but one meta-box how can I have the user add each ingredient click a button "add" and when they are done adding and when they publish the post that full list of ingredients is saved? Would they use Ajax or something to enter the attributes values click "add" and that entry is added to some sort of static view array and the fields are blank again so they can add another.


modify wordpress default search

I would like to modify WordPress default search. I have 2 questions: which template file to modify, and how can I include posts ids that I want to include in search? I need to search from specific post ids, so I want to modify search in this particular way.


Disabling All in One Seo Pack plugin in functions.php does not work

Here is my code:               function my_title($title) {               global $aiosp;     if ( defined('AIOSEOP_VERSION') ) {                error_log( print_r( $aiosp, true) );               remove_action('wp_head',array($aiosp,'wp_head'));          }          return  $title;     }          add_filter('wp_head','my_title',20,1);      $aiosp is not empty I also tried to change the priority argument to be sure that my function runs after all in one seo pack hook , but it does not help. Thanks


How add column from new table in Custom Post Listing (admin)

I'm making an plugin to manage, say, Recipe. I created a table containing informations about my recipes. I'v created a custom post to add recipe, I know how to add meta box to the post to enter infos stored in my table. But how can i use some of the informations of my table in the list of my Recipe Custom Post in the admin panel. How add a join with my table in the query retreiving the posts. Thanks.


profile.php sometime returns webpage not available for subscriber. Why?

I have a problem with my WordPress site when I log in into site being a subscriber and want edit my profile sometimes it retuens **Webpage not available** , or sometime it works fine. I don't know why. The error page look like :![enter image description here](http://i.stack.imgur.com/p9X8U.png) Can any one help me to figure this out. Thanks, Biswajit Ghosh


Is there a security risk giving someone temporary access to my blog's code?

My blog is painfully slow for the last few days, and I would like to pay someone (anyone?) 15 BitCoins to optimize it for me (I would do it myself, but I'm not sure I have the time right now). It's currently hosted at GoDaddy. What I'm thinking is giving him a snapshot of the filestructure of my blog, and asking him to setup an Amazon EC2 image that will run it. After I test his image, I will switch my domain to point to the new EC2 instance and change the admin password. My blog is rather small (only 80 readers), and I gather I don't have anything vital/precious/secret there. The private information I could think of that I wouldn't want leaked is perhaps a few emails addresses from some of my users (not that happy about it being leaked, but I **assume** that email addresses aren't that expensive, and nobody will have the incentive to do anything interesting with them). Do you think it's a viable option? Or instead, should I absolutely not do, in order to protect my user' privacy? What are security risks are there? BTW, I don't yet have anyone specific in mind. If you're interested, ping me at ron.gross@gmail.com. **Edit** - cross link to the post on bitcoin.org forums.


Problems with moving wp-content to a subdomain

Got a little problem. I wanted to move wp-content to a subdomain (content.sitename.com) but there's a weird problem when rendering PHP-Content (e.g. style.css.php). Every PHP file in "content.sitename.com" or in it's real folder "sitename.com/content" redirects to the regular domain (www.sitename.com) instead of giving back the PHP output. Absolute path: /var/www/USER/SITENAME.com/ Here's my wp-config:               define( 'DISALLOW_FILE_EDIT', true );          define('ABSPATH', dirname(__FILE__) . '/');          if (isset($_SERVER['SCRIPT_FILENAME']) && 'wp-config.php' == basename($_SERVER['SCRIPT_FILENAME']))     die ('
Error 404 - Not found
');          define( 'WP_ALLOW_MULTISITE', true );     define('MULTISITE', true);     define( 'SUBDOMAIN_INSTALL', false );     define('DOMAIN_CURRENT_SITE', 'www.sitename.com');     define('PATH_CURRENT_SITE', '/');     define('SITE_ID_CURRENT_SITE', 1);     define('BLOG_ID_CURRENT_SITE', 1);          define( 'WP_CONTENT_DIR', ABSPATH . '/content' );     define( 'WP_CONTENT_URL', 'http://content.sitename.com' );     define ('WP_PLUGIN_DIR', WP_CONTENT_DIR.'/plugins');     define ('WP_PLUGIN_URL', WP_CONTENT_URL.'/plugins');     define( 'UPLOADS', '/media' );     define('WP_MEDIA_FOLDER', 'http://media.sitename.com/');     $theme_root = WP_CONTENT_DIR . '/themes';          define( 'BWPS_FILECHECK', true );               define('DB_NAME', 'xxx');     define('DB_USER', 'xxx');     define('DB_PASSWORD', 'xxx');     define('DB_HOST', 'xxx');     define('DB_CHARSET', 'utf8');     define('DB_COLLATE', '');     define( 'WPCF7_ADMIN_READ_CAPABILITY', 'manage_options' );     define( 'WPCF7_ADMIN_READ_WRITE_CAPABILITY', 'manage_options' );     define( 'WP_POST_REVISIONS', false);     define( 'WP_DEBUG', false);     define('AUTH_KEY',         'xxx');     define('SECURE_AUTH_KEY',  'xxx');     define('LOGGED_IN_KEY',    'xxx');     define('NONCE_KEY',        'xxx');     define('AUTH_SALT',        'xxx');     define('SECURE_AUTH_SALT', 'xxx');     define('LOGGED_IN_SALT',   'xxx');     define('NONCE_SALT',       'xxx');     $table_prefix  = 'xxx_';          if ( !defined('ABSPATH') )     define('ABSPATH', dirname(__FILE__) . '/');     require_once(ABSPATH . 'wp-settings.php');          ?>      Here's my .htaccess:               # BEGIN Better WP Security     Options -Indexes          # Begin HackRepair.com Blacklist     RewriteEngine on     # Abuse Agent Blocking     RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Bolt\ 0 [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:craftbot\@yahoo\.com [NC,OR]     RewriteCond %{HTTP_USER_AGENT} CazoodleBot [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Custo [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Default\ Browser\ 0 [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^DIIbot [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^DISCo [NC,OR]     RewriteCond %{HTTP_USER_AGENT} discobot [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Download\ Demon [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^eCatch [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ecxi [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^EmailCollector [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Express\ WebPictures [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^FlashGet [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^GetRight [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^GrabNet [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Grafula [NC,OR]     RewriteCond %{HTTP_USER_AGENT} GT::WWW [NC,OR]     RewriteCond %{HTTP_USER_AGENT} heritrix [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^HMView [NC,OR]     RewriteCond %{HTTP_USER_AGENT} HTTP::Lite [NC,OR]     RewriteCond %{HTTP_USER_AGENT} HTTrack [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ia_archiver [NC,OR]     RewriteCond %{HTTP_USER_AGENT} IDBot [NC,OR]     RewriteCond %{HTTP_USER_AGENT} id-search [NC,OR]     RewriteCond %{HTTP_USER_AGENT} id-search\.org [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Image\ Stripper [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Image\ Sucker [NC,OR]     RewriteCond %{HTTP_USER_AGENT} Indy\ Library [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^InterGET [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Internet\ Ninja [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^InternetSeer\.com [NC,OR]     RewriteCond %{HTTP_USER_AGENT} IRLbot [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ISC\ Systems\ iRc\ Search\ 2\.1 [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Java [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^JetCar [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^JOC\ Web\ Spider [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^larbin [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [NC,OR]     RewriteCond %{HTTP_USER_AGENT} libwww [NC,OR]     RewriteCond %{HTTP_USER_AGENT} libwww-perl [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Link [NC,OR]     RewriteCond %{HTTP_USER_AGENT} LinksManager.com_bot [NC,OR]     RewriteCond %{HTTP_USER_AGENT} linkwalker [NC,OR]     RewriteCond %{HTTP_USER_AGENT} lwp-trivial [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Mass\ Downloader [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Maxthon$ [NC,OR]     RewriteCond %{HTTP_USER_AGENT} MFC_Tear_Sample [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^microsoft\.url [NC,OR]     RewriteCond %{HTTP_USER_AGENT} Microsoft\ URL\ Control [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^MIDown\ tool [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Mister\ PiX [NC,OR]     RewriteCond %{HTTP_USER_AGENT} Missigua\ Locator [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Mozilla\.*Indy [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Mozilla\.*NEWT [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^MSFrontPage [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Navroad [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^NearSite [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^NetAnts [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^NetSpider [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Net\ Vampire [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^NetZIP [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Nutch [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Octopus [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Offline\ Explorer [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Offline\ Navigator [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [NC,OR]     RewriteCond %{HTTP_USER_AGENT} panscient.com [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Papa\ Foto [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^pavuk [NC,OR]     RewriteCond %{HTTP_USER_AGENT} PECL::HTTP [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^PeoplePal [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [NC,OR]     RewriteCond %{HTTP_USER_AGENT} PHPCrawl [NC,OR]     RewriteCond %{HTTP_USER_AGENT} PleaseCrawl [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^psbot [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^RealDownload [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^ReGet [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Rippers\ 0 [NC,OR]     RewriteCond %{HTTP_USER_AGENT} SBIder [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^SeaMonkey$ [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^sitecheck\.internetseer\.com [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [NC,OR]     RewriteCond %{HTTP_USER_AGENT} Snoopy [NC,OR]     RewriteCond %{HTTP_USER_AGENT} Steeler [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^SuperBot [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Surfbot [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Teleport\ Pro [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Toata\ dragostea\ mea\ pentru\ diavola [NC,OR]     RewriteCond %{HTTP_USER_AGENT} URI::Fetch [NC,OR]     RewriteCond %{HTTP_USER_AGENT} urllib [NC,OR]     RewriteCond %{HTTP_USER_AGENT} User-Agent [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Web\ Image\ Collector [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Web\ Sucker [NC,OR]     RewriteCond %{HTTP_USER_AGENT} Web\ Sucker [NC,OR]     RewriteCond %{HTTP_USER_AGENT} webalta [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^WebAuto [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^[Ww]eb[Bb]andit [NC,OR]     RewriteCond %{HTTP_USER_AGENT} WebCollage [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^WebCopier [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^WebFetch [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^WebGo\ IS [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^WebReaper [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^WebSauger [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Website\ eXtractor [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Website\ Quester [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^WebStripper [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^WebZIP [NC,OR]     RewriteCond %{HTTP_USER_AGENT} Wells\ Search\ II [NC,OR]     RewriteCond %{HTTP_USER_AGENT} WEP\ Search [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Wget [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Widow [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^WWW-Mechanize [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [NC,OR]     RewriteCond %{HTTP_USER_AGENT} zermelo [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^Zeus [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^(.*)Zeus\.*Webster [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ZyBorg [NC]     RewriteRule ^.* - [F,L]     # Abuse bot blocking rule end     # End HackRepair.com Blacklist     <files .htaccess>     Order allow,deny     Deny from all     </files>          <files readme.html>     Order allow,deny     Deny from all     </files>          <files readme.txt>     Order allow,deny     Deny from all     </files>          <files install.php>     Order allow,deny     Deny from all     </files>          <files wp-config.php>     Order allow,deny     Deny from all     </files>          <IfModule mod_rewrite.c>     RewriteEngine On          RewriteRule ^wp-admin/includes/ - [F,L]     RewriteRule !^wp-includes/ - [S=3]     RewriteCond %{SCRIPT_FILENAME} !^(.*)wp-includes/ms-files.php     RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]     RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]     RewriteRule ^wp-includes/theme-compat/ - [F,L]          RewriteCond %{REQUEST_METHOD} ^(TRACE|DELETE|TRACK) [NC]     RewriteRule ^(.*)$ - [F,L]          RewriteCond %{REQUEST_METHOD} POST     RewriteCond %{REQUEST_URI} ^(.*)wp-comments-post\.php*     RewriteCond %{HTTP_REFERER} !^(.*)sitename.com.*     RewriteCond %{HTTP_REFERER} !^http://jetpack\.wordpress\.com/jetpack-comment/ [OR]     RewriteCond %{HTTP_USER_AGENT} ^$     RewriteRule ^(.*)$ - [F,L]          RewriteCond %{QUERY_STRING} \.\.\/ [NC,OR]     RewriteCond %{QUERY_STRING} ^.*\.(bash|git|hg|log|svn|swp|cvs) [NC,OR]     RewriteCond %{QUERY_STRING} etc/passwd [NC,OR]     RewriteCond %{QUERY_STRING} boot\.ini [NC,OR]     RewriteCond %{QUERY_STRING} ftp\:  [NC,OR]     RewriteCond %{QUERY_STRING} http\:  [NC,OR]     RewriteCond %{QUERY_STRING} https\:  [NC,OR]     RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]     RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|%3D) [NC,OR]     RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR]     RewriteCond %{QUERY_STRING} ^.*(\[|\]|\(|\)|<|>|ê|"|;|\?|\*|=$).* [NC,OR]     RewriteCond %{QUERY_STRING} ^.*("|'|<|>|\|{||).* [NC,OR]     RewriteCond %{QUERY_STRING} ^.*(%24&x).* [NC,OR]     RewriteCond %{QUERY_STRING} ^.*(127\.0).* [NC,OR]     RewriteCond %{QUERY_STRING} ^.*(globals|encode|localhost|loopback).* [NC,OR]     RewriteCond %{QUERY_STRING} ^.*(request|select|concat|insert|union|declare).* [NC]     RewriteCond %{QUERY_STRING} !^loggedout=true     RewriteCond %{QUERY_STRING} !^action=rp     RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in_.*$     RewriteCond %{HTTP_REFERER} !^http://maps\.googleapis\.com(.*)$     RewriteRule ^(.*)$ - [F,L]          RewriteRule ^login/?$ /wp-login.php?SECRETKEY [R,L]          RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in_.*$     RewriteRule ^admin/?$ /wp-login.php?SECRETKEY&redirect_to=/wp-admin/ [R,L]          RewriteRule ^admin/?$ /wp-admin/?SECRETKEY [R,L]          RewriteRule ^register/?$ /wp-login.php?SECRETKEY&action=register [R,L]          RewriteCond %{SCRIPT_FILENAME} !^(.*)admin-ajax\.php     RewriteCond %{HTTP_REFERER} !^(.*)sitename.com/wp-admin     RewriteCond %{HTTP_REFERER} !^(.*)sitename.com/wp-login\.php     RewriteCond %{HTTP_REFERER} !^(.*)sitename.com/login     RewriteCond %{HTTP_REFERER} !^(.*)sitename.com/admin     RewriteCond %{HTTP_REFERER} !^(.*)sitename.com/register     RewriteCond %{QUERY_STRING} !^SECRETKEY     RewriteCond %{QUERY_STRING} !^action=logout     RewriteCond %{QUERY_STRING} !^action=rp     RewriteCond %{QUERY_STRING} !^action=register     RewriteCond %{QUERY_STRING} !^action=postpass     RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in_.*$     RewriteRule ^.*wp-admin/?|^.*wp-login\.php / [L,R=404]          RewriteCond %{QUERY_STRING} ^loggedout=true     RewriteRule ^.*$ /wp-login.php?SECRETKEY [R,L]     </IfModule>     # END Better WP Security          #SECRETKEY          AddType text/x-component .htc          IndexIgnore *          <IfModule mod_rewrite.c>     #Options +FollowSymLinks     RewriteEngine on     #RewriteCond %{HTTP_HOST} ^sitename [NC]     #RewriteRule ^(.*)$ http://sitename.com/$1 [L,R=301]                  RewriteCond %{THE_REQUEST} !^[A-Z]{3,9}\ .+\ HTTP/(0\.9|1\.0|1\.1) [NC]             RewriteRule .* - [F,NS,L]             RewriteCond %{REQUEST_METHOD} !^(GET|HEAD|POST|PROPFIND|OPTIONS)$ [NC]             RewriteRule .* - [F,NS,L]             RewriteCond %{REQUEST_METHOD} =POST             RewriteCond %{HTTP_USER_AGENT} ^-?$             RewriteRule .* - [F,NS,L]             RewriteCond %{REQUEST_METHOD} =GET [OR]             RewriteCond %{REQUEST_METHOD} =POST [OR]             RewriteCond %{REQUEST_METHOD} =HEAD             RewriteCond %{QUERY_STRING} (ftps?|https?):// [NC,OR]             RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC]             RewriteRule .* - [F,NS,L]             RewriteCond %{QUERY_STRING} (\.\./|/\.\.|\./\.)                  RewriteCond %{REQUEST_URI} \.svn [NC]             RewriteRule .* - [F,NS,L]          # BEGIN WordPress     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]          # uploaded files     RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]          # add a trailing slash to /wp-admin     RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]     RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]     RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]     RewriteRule . index.php [L]          # END WordPress          </IfModule>      Can someone help me out with this? I can't get it to work. **Edit:** Added relevant code. @Mark Kaplun First I tested the site locally (sitename.local, without the subdomain - couldn't get it to work locally), then I uploaded the Wordpress folder to my webspace. Then I made a SQL-Dump and replaced all the paths from /wp-content/ to content.sitename.com and imported it via PHPmyadmin. Everything works, I can browse the site and everything but every PHP on content.sitename.com (e.g. content.sitename.com/themes/THEMENAME/css/style.css.php ) just redirects me back to sitename.com


new post-type how do i retain the plugins on my sidebar?

I created a new post-type following this technique: (http://www.wpbeginner.com/wp-tutorials/how-to-use-custom-post-types/) After creating a a new post-type some of the feature of the a regular post also disappeared. I installed a plugin (SEO Pressor) that helps my seo on creating a new post. That plugin can be seen in the sidebar when you create a new post, Together with "Publish", "Categories" etc.. . currently the new post-type only contains the "Publish" and "Attributes" block. Any idea how I can call those plugin to my new post-type? Thanks!


single page wordpress

I like wordpress as a CMS and I think it's got a lot there with it's vast plugin library however the front end, dare I say it is a bit out of date. I don't like the system of old going page-to-page and would prefer a single- page site powered by JSON/AJAX. I've used wordpress to make simple client sites but when it comes to anything more impressive, the system of templates which wordpress has is a bit lacking. I'm used to using Backbone.js and Knockout.js for frameworks and require.js for module loading. I'm looking for a plugin or source reference for effectively removing the wordpress front end and using CRUD/REST and Javascript to build single page dynamic sites. Can anyone point me in the right direction?


What are the ADVANTAGES of ORIGINAL wordpress template structure?

**Precondition:** coming from a Custom PHP applications(using symfony, zend and so on) world, for me it feels unnatural to have template separated in a way that is done in original wordpress theme. e.g top part of a page is in header, center in a "index, page..." and bottom part in a footer. example of current structure: index.php               [include header]     ... main content...     [include footer]      and header.php               <html>         <head>           ....         </head>         <body>           .....      and footer.php                      .....        </body>     </html>      I am more used to the structure where you have a layout and include other (partials) template inside it. example: index.php template                   <html>           <head> [include header] </head>            <body>                [include body] [include    footer]            </body>          </html>      So I am trying to think about advantages of original wordpress template structure. **Question:** What are the ADVANTAGES of ORIGINAL wordpress template structure in contrast to the SECOND example I described above ?


How do I Import an RSS feed as Wordpress posts without duplicates?

I have an XML feed url I am now using this code to create new Custom Post Type Posts from an rss feed in my functions.php file:                   /*     | -------------------------------------------------------------------     | Schedule and update fashion news with the news rss feed     | -------------------------------------------------------------------     |      | */          if (!wp_next_scheduled('update_feed'))         wp_schedule_event(current_time('timestamp'), 'hourly', 'update_feed');          add_action('update_feed', 'update_fashion_news');          function update_fashion_news() {         // retrieve the previous date from database             $time = get_option('latestpostdate');                  //read the feed             if(function_exists('fetch_feed')){                 $uri = 'http://www.sitename.com/feed.xml';                 $feed = fetch_feed($uri);             }                  if($feed) {                      foreach ($feed->get_items() as $item){                     $titlepost = $item->get_title();                     $content = $item->get_content();                     $description = $item->get_description();                     $itemdate = $item->get_date();                     $media_group = $item->get_item_tags('', 'enclosure');                     $img = $media_group[0]['attribs']['']['url'];                     $width = $media_group[0]['attribs']['']['width'];                                // $latestItemDate = $feed->get_item()->get_date();                               // if the date is < than the date we have in database, get out of the loop                     if( $itemdate <= $time) break;                               // prepare values for inserting                          $post_information = array(                         'post_title' => $titlepost,                         'post_content' => $description,                         'post_type' => 'fashionnews',                         'post_status' => 'publish',                         'post_date' => date('Y-m-d H:i:s')                     );                          wp_insert_post( $post_information );                          }             }             // update the new date in database to the date of the first item in the loop                     update_option( 'latestpostdate', $feed->get_item()->get_date() );     }      [UPDATE: Have updated the code above to move from simple_xml to using simplepie] [UPDATE2: Have moved the code and wrapped it in a WP schedule event as advised by @Mridul below] I am still checking to see if my code works when the next batch of news updates arrive. Does anyone think this code wouldn't work for some reason?


get_the_category and echo out link to child-most/deepest category

I have this code which is located on the search.php page and retrieves all the categories for each post and echo's out a link to the first category:               $category = get_the_category(); //print_r($category);     if ($category) {       echo 'term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category[0]->name ) . '" ' . '>' . $category[0]->name.' ';      What I need to do is use a similar code but that gets the child-most/deepest category in the array? This is the array thats printed out:               [0] => stdClass Object         (             [term_id] => 170             [name] => ACS Series Suspended & Crane Scales - EC Approved             [slug] => uwe-acs-series-suspended-crane-scales             [term_group] => 0             [term_taxonomy_id] => 170             [taxonomy] => category             [description] =>              [parent] => 3             [count] => 4             [object_id] => 1578             [cat_ID] => 170             [category_count] => 4             [category_description] =>              [cat_name] => ACS Series Suspended & Crane Scales - EC Approved             [category_nicename] => uwe-acs-series-suspended-crane-scales             [category_parent] => 3         )          [1] => stdClass Object         (             [term_id] => 3             [name] => Crane Scales             [slug] => crane-scales             [term_group] => 0             [term_taxonomy_id] => 3             [taxonomy] => category             [description] =>              [parent] => 0             [count] => 53             [object_id] => 1578             [cat_ID] => 3             [category_count] => 53             [category_description] =>              [cat_name] => Crane Scales             [category_nicename] => crane-scales             [category_parent] => 0         )      As you can see, one category has parent->3 and the other has parent->0. How do I use the above query to print out the link only for a category with parent->3? Its probably quite simple but its a bit over my head. Any help would be greatly appreciated! Thanks Dave


Show All Posts Insert Edit Link

When I click to insert/edit link in the tinyMCE rich editor for a post, then click "Or link to existing content", it shows only posts that are live and published. Is there a way to get the list that is searched to also include future and draft posts? I need to do this without modifying any core files, is there a hook I can tap into to modify the called query?


Issue with wp_schedule_event()

I am trying to set up an event on a custom interval that will grab new posts from an Instagram search and create them as wordpress posts. I had the code working on its own page, and now I am trying to schedule it to happen automatically. I have also installed Wp Crontroller to ensure the event is being recognized by Wordpress (which it is) but I cannot seem to get the code to run (nor can I figure out how to debug it.               add_action( 'wp', 'create_schedule' );          function create_schedule() {       wp_schedule_event(time(), 'quarter_hour', 'ig_fetch_start');       update_option('test', 'Close!');     }          add_action('ig_fetch_start','ig_fetch_new_posts');          function ig_fetch_new_posts() {       update_option('test', 'Fired');       // Run function     }      The option update is in there just to see if the event is firing. Wordpress simple never seems to make it to the ig_fetch_new_posts function.


Where can I find a real architecture document on Wordpress?

I can only find some db schemas, what about all the rest of business logics in UML ?


Is there a quick way to find out what posts haven't been tagged?

Basically exactly what the title says, I am running 3.0.1 and want to be able to quickly flag up posts that have no tags currently assigned to them.


White Blank Page when Updating and Publishing Page/Post

I have a serious problem here, every time I publish and update a page/post it displays a white blank page.. here I don't know how to fix it.. is there anyone that can help me? Thanks :)


wp redirect 301 not working in wordpress page

http://www.mywebsite.com/my-page on my wordpress page i have a form and i am redirecting my wordpress page to some other website after form submit i have following code in my functions.php file for submitting form.               add_action('init', 'redirect');     function redirect(){     if(isset($_post['submit']))     {         wp_redirect("www.google.com",301); exit();          }     }      but its not redirecting and showing 404 error and following url on submit http://www.mywebsite.com/my-post/www.google.com here i am using shortcode to display form on my wordpress page. what is the reason? any clue?


Forum for wordpress - Super confused!

I want to start a website/blog on wordpress and am also thinking about integrating a forum in it. Now, I have been reading reviews about forums for wordpress like BB press, Simple Forum, Mingle, etc. Some say bbpress doesnt have many features. Others say Simple forum cant be customized. I a novice. I dont know php coding and all. I can learn though. I want to install a forum in my wordpress website that doesnt really need coding and all. Something that has many features, is highly customizable and goes well with the theme of my wordpress website. If I could have a Q/A forum like stackexchange, that would be so awesome! I want the forum to be incorporated in my website only so that users dont have to login to two different websites. Someone please clear my doubts and suggest which way to go!? Thanks :)) edit- can someone please help me out in here? : /


Remove user credentials from GET or POST on login

This may be a totally noob question but... I noticed that, with the standard Wordpress install, it seems like one can obtain the user's login credentials just by viewing the GET and/or POST vars returned when WP-Login does its thing. Is there a way to strip (or at least obscure) these so they can't be viewed in a tool for viewing HTTP headers?


How to sort terms with diacritical signs?

I have list of terms which happens to be the Polish Alphabet. Here's how I list these terms:
     <?php         $terms = get_terms("taxonomy", array('orderby' => 'title', 'hide_empty' => 0));        foreach ( $terms as $term ) {           echo "
slug, $term->taxonomy ) ."'>" . $term->name . "
";        } ?>        Everything works like a charm excepting one thing - the letter that is supposed to be after "L" ("Ł") is always the last element o that list (so it's after "Ż", not "L"). Is there any way to fix it? I've been trying multiple WP versions including Polish builds. Any ideas? I can always do two foreach loops for A-L and M-Ż and add that one between them, but would love to do that with more class.


With get_posts(), how can I put a category as a variable

I'm a noob at this so please bear with me. I have the following code to return post title as links within categoryID 6, which is working fine:               <?php global $post; $cat_posts = get_posts('numberposts=10&category=6');       foreach($cat_posts as $post) : ?>         <?php $postTitle = get_the_title(); if($title != $postTitle) :?>
<a href="<?php the_permalink(); ?>">›› <?php the_title(); ?>
         <?php endif ;?>     <?php endforeach; ?>      However, the category ID is a variable, e.g. $catID, can I use this in the above code? Thanks in advance!


How to auto-upgrade my plugin?

How do I have my plugin pop up with that `New version available. Upgrade Automatically` dialog to appear when my plugin has a new version? Specifically for plugins not hosted on the WP.org repository.


How can we hide the parent's theme url at the child themes details on a multisite?

I hope the title makes sense. But anyway, to clear things up, here is a screen shoot of what I mean: ![enter image description here](http://i.stack.imgur.com/3DjcV.jpg) To be honest I really don't see how site admins benefit from this piece of information since they cannot edit the files. I have tried using:               div.themedetaildiv p {         display:none !important;     }      but it hides everything and NOT just the second paragraph. Any ideas? Thanks.


Need some templating advice for templating with custom post types and taxonomies

I'm setting up a "Design Show Winners" section for a design organization that runs it's site off WordPress. For ease of use, I'd like it to be a custom post type of "Design Show Winners" with non-hierarchical taxonomies of "Entry Year", "Entry Category", "Designer or Firm", and then a couple other pieces of custom field meta data. The part I'm struggling with is that each year will have 3 distinctly different pages: a landing page, list of winners, and a winner detail page. We will want to add new ones every year without getting rid of or modifying the old ones. Each year, about 70 or so winning pieces will be added, you can see how selecting a parent page in a drop-down with several hundred options would be unwieldy. That's why I'd like to keep the year as a taxonomy rather than a hierarchical post type. On top of that, we want to have these other taxonomies (Entry Category, Designer or Firm) be search-able cross-year (as in all years, or just searching by taxonomy) using a templates that match the default style of their site. Also, the people who would adding the new sites are not that technical beyond HTML and CSS, so if there is a way we could do this with a template page, that would be ideal. I saw this post mention creating custom template redirects. Could I possibly use something like that to accomplish my goal? If so, how. I know this isn't exactly your run of the mill WordPress issue, so if somebody could point me in the right direction on this issue, I'd really appreciate it. Thanks.


Blocking author paging for blog entries?

I've noticed on our WordPress blog that I get Google hits on two forms of blog entries: `http://blog.stackoverflow.com/2011/01/twitter-question-feeds-for-stack- exchange/` and `http://blog.stackoverflow.com/author/admin/page/4/` The latter form, paginating by author, is _definitely_ not wanted. How can I block paging by author in WordPress? I do know how to block it in robots.txt (which I will do!) but I would prefer to turn off author paging entirely, if possible.


get_site_url is not returning anything?

I'm using the twentyten theme with the bbpress plugin. I have the following in my header.php (twentyten):

<a href="<?php get_site_url(); ?>">TaiwanTalk

                 <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>

      `get_site_url` doesn't return anything. Any suggestions?


Test editor problem

![enter image description here](http://i.stack.imgur.com/9xMZC.png) I want to write a post in word-press but why only html editor in the text box?


jQuery gallery plugin to interface with Picasa

I'm looking for a specific type of gallery plugin implementation. First of all, it needs to be able to pull from Picasa. Second, I would like it to basically be a static lightbox...and what I mean by this is:   * Single image displayed with previous/next buttons   * Able to display the image title/description   * Able to display `Image <x> of <y>`   * Preferably make use of jQuery At this point, I'd prefer to hide all gallery thumbnails and give the focus on the main image. If thumbnails could be easily hidden and shown with a config option, that would be OK.


Insert PHP code via shortcode?

I wanted to insert a form with a line of PHP code via shortcode. I am wondering if it's allowed? Has anyone tried it? Take the following for example:               function get_form($atts) {         return '<form method="post" action="">                 <input type="input" name="myinput" value=""></input>                 <input type="hidden" name="myvar" value="<?php echo $current_user->ID; ?>">                 </form>';     }     add_shortcode('myshortcode', 'get_form');      I hope it's clear now...


Using a nonce in a Custom Login Form

I am trying to create my own login form for WordPress using wp-login.php as a template. In the form that is used to collect login information from the user (lines 680 through 703 of wp-login.php), there doesn't seem to be any implementation of a nonce. I have been told by quite a few people that I should always be using a nonce when collecting information from forms - but there is not a single reference to a nonce in this entire file - despite their being four fairly critical forms. So - what am I missing? I know that the login form uses a testcookie and that you create a securecookie when reading through the POST information - but does that somehow solve the security issue? Are there any good resources out there for understanding how secure cookies work in this instance?


Force download a file within plugin file

I am trying to make a plugin which will force a certain file to download. I cannot find any examples of other people downloading files using a wordpress plug in. I simplified the code a little bit. I believe everything works until this part:                 header('Content-type: application/zip');         header('Content-Disposition: attachment; filename="'.$destination.'"');         echo readfile($destination);         // remove zip file is exists in temp path         unlink($destination);      Here is the code:                   function get_cart_urls(){     //get a string of urls from an ajax request                 $urlsCSV= $_POST['urlsCSV'];          //convert the string into an array            $urlArray= explode(',', $urlsCSV);                  $destination = "Files.zip";             $files = $urlArray;             $overwrite = true;                      //if the zip file already exists and overwrite is false, return false         if(file_exists($destination) && !$overwrite) { $error .= "yeha ";}         //vars         $valid_files = array();         //if files were passed in...         if(is_array($files)) {             //cycle through each file             foreach($files as $file) {                 //make sure the file exists                 if(file_exists(getcwd().$file)) {                     $valid_files[] = getcwd().$file;                 }             }         }         //echo count($valid_files);         //if we have good files...         if(count($valid_files)) {             //create the archive             $zip = new ZipArchive();                  if($zip->open($destination,$overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE) !== true) {                 $error = "yeah ";             }else{                 $error = "no error";                 }             //add the files             foreach($valid_files as $file) {                 $zip->addFile($file,$file);             }             //debug             echo $error." ".'The zip archive contains ',$zip->numFiles,' files with a status of ',$zip->status;                  //close the zip -- done!             $zip->close();                   if(file_exists($destination)){                 // push to download the zip                 header('Content-type: application/zip');                 header('Content-Disposition: attachment; filename="'.$destination.'"');                 echo readfile($destination);                 // remove zip file is exists in temp path                 unlink($destination);             }         die();


Exporting WordPress -> Flickr

I have all of my images stored in posts on my Wordpress blog, but I'm a tad worried what would happen if my web host were to go offline. I could back them all up by zipping the wp-content/uploads folder, but ideally I'd like to export these photos to Flickr. Is there any way to export (with metadata) the images to Flickr?


Adding Custom Taxonomy to WordPress default Post type

I am trying to add custom taxonomy (tags) to WordPress default post type. because I wanna use that taxonomy for custom post type as well.               // Register Custom Taxonomy     function tag_synchro() {          $labels = array(         'name'                       => _x( 'QA Tags', 'Taxonomy General Name', ET_DOMAIN ),         'singular_name'              => _x( 'QA Tag', 'Taxonomy Singular Name', ET_DOMAIN ),         'menu_name'                  => __( 'QA Tags', ET_DOMAIN ),         'all_items'                  => __( 'All Tags', ET_DOMAIN ),         'parent_item'                => __( 'Parent Item', ET_DOMAIN ),         'parent_item_colon'          => __( 'Parent Item:', ET_DOMAIN ),         'new_item_name'              => __( 'New Tags Name', ET_DOMAIN ),         'add_new_item'               => __( 'Add New tag', ET_DOMAIN ),         'edit_item'                  => __( 'Edit tag', ET_DOMAIN ),         'update_item'                => __( 'Update tag', ET_DOMAIN ),         'separate_items_with_commas' => __( 'Separate tags with commas', ET_DOMAIN ),         'search_items'               => __( 'Search Items', ET_DOMAIN ),         'add_or_remove_items'        => __( 'Add or remove items', ET_DOMAIN ),         'choose_from_most_used'      => __( 'Choose from the most used tagd', ET_DOMAIN ),         'not_found'                  => __( 'Not Found', ET_DOMAIN ),     );     $args = array(         'labels'                     => $labels,         'hierarchical'               => false,         'public'                     => true,         'show_ui'                    => true,         'show_admin_column'          => true,         'show_in_nav_menus'          => true,         'show_tagcloud'              => true,         'update_count_callback'      => '_update_post_term_count',         'query_var'             => true,         'rewrite'               => array( 'slug' => ae_get_option('tag_slug', 'qa-tag') ),         );     register_taxonomy( 'qa_tag', array( 'post' ), $args );          }          // Hook into the 'init' action     add_action( 'init', 'tag_synchro', 0 );      I used above code, and it's seems not working. is there any way I can accomplish this work. Thank you in advance


Add sidebar in inner pages

I am new to wordpress coding. I want to add a sidebar to pages other than the home page, both pages are my custom templates. I want to list in admin so that admin can edit the content of sidebar. Also, do I need to create widget to display every side bar?


What functions are included in apply_filter('the_content')

There is a function called apply_filter where you can use it like this:               echo apply_filter('the_content', $my_content);      It add formatting tags and clean up the content. **Trac or docs** I looked in the trac and docs but could not find what functions are used in the apply_filter function. **I found wpautop** The only one I found was wpautop: http://codex.wordpress.org/Function_Reference/wpautop What more? Hint me to the trac or some docs with a list of functions that are used.


How do you filter get_media_items by mime type in a custom media upload tab?

I've gotten as far as creating my new tab and getting it to show up and I've taken a copy of the gallery screen (I'm making an audio plugin with a playlist feature). The list of media items shows up fine but I can only get it to show just the audio files when I don't pass a post ID into the `get_media_items()` function like in the media library tab. How I can retrieve a media items list using `get_media_items()` where the post_parent field is set and the post_mime_type matches 'audio'?


Prioritising and Ordering Posts By Category Name Using A Custom Loop

I have a custom loop pulling out videos all assigned to various categories. However there is a category called "new-video" and I need to pull out all videos using my custom loop, but I would like the posts assigned to the category "new-video" to be shown first. So basically the loop will treat the category "new-video" as of high priority and then show the other videos afterwards. I know you can include and exclude categories, but I don't want to exclude anything, merely prioritise. With Wordpress 3.1 *meta_query* was introduced which allows for some pretty customisable queries, but the documentation is sparse and all of my searches thus far have returned nothing I can use. The code I am currently using is the below if it helps:               $videos = get_posts(array(      'post_type' => 'videos',      'nopaging' => true,      'each_connected' => array(         'post_type' => 'artists',         'nopaging'  => true,      ),      'suppress_filters' => false     ));      Ignore the each_connected stuff, that is there because I am using the plugin Posts to Posts by Scribu.


Media Library plugins for better file management?

Is there any plugin to extend the basic functionality of the Media Library for websites with a lot of media content? A folder structure would be awesome...at the moment I am using the Media Tags plugin but I am wondering if there is something more powerful around. Any suggestion? Thanks


Is comment metadata included in the export file?

If I would export a WordPress database, posts and comments etc. are saved to an XML file.   Would comment metadata be included in this XML file? I.e. the table `wp_commentmeta`, mentioned here: http://codex.wordpress.org/Database_Description#Table:_wp_commentmeta. Here:   The WordPress eXtended Rss (WXR) Export/Import, XML Document Format Decoded and Explained   I found some info on the export file format, and the columns in `wp_comments` are mentioned, but there's no mentioning of any columns in `wp_commentmeta`. **Edit:** Background: I'm planning to write a new commenting system for WordPress, and I'd like to be able to import/export comment data between various blog platforms. (E.g. Blogger and others.) And I think I need to use the comment metadata table. **/Edit** Kind regards, Magnus


Dashboard like meta boxes in my plugin - how to save their position and open/closed state?

I am trying to mimic the dashboard meta boxes UI in my WP plugin - the small metaboxes. I have already styled them and also the drag & drop feature works as I loaded the following script and style:               wp_enqueue_style('dashboard');     wp_enqueue_script('dashboard');      However I also would like to save my custom "postboxes" position (order) and also the open/close state. Any ideas how could this be achieved? Thanks. **UPDATE:** This is the structure of my postbox:

<?php echo get_admin_page_title(); ?>

<?php echo get_admin_page_title(); ?>

first

<?php echo get_admin_page_title(); ?>

second

              <form style="display:none" method="get" action="">             <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false ); ?>             <?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false ); ?>         </form>


Wordpress Options Page Theory Question

I created an options page and it is functioning perfectly, but I am not sure I understand **how** it functions. It's cool I got it to work but I was hoping someone could help explain _why_ it works. Here is the code:                <?php              add_action('admin_menu', 'add_custom_options');                    function add_custom_options()             {                 add_options_page('Custom Options', 'Slider Settings', 'manage_options', 'functions','custom_options');             }                   function custom_options()         {         ?>

Custom Options
         <form method="post" action="options.php">         <?php wp_nonce_field('update-options') ?>              <input type="text" name="options_value" size="85" value="<?php echo get_option('options_value'); ?>" />
<input type="submit" name="Submit" value="Store Options" />
         <input type="hidden" name="action" value="update" />         <input type="hidden" name="page_options" value="options_value" />              </form>
     <?php     }     ?>      Where are these values being stored? There's a reference to `options.php` but my theme doesn't have an `options.php.` I am just trying to wrap my head around what I made to try and better understand it's logic; I am also curious if I went about it the right way. The option(s) I store are retrieved within the theme (image url for example). Thanks in advance.


WordPress 3.8 Backend Admin Color Scheme add more scheme how to do?

How can I add additional admin color schemes into Wordpress 3.8? I want to add two more with a yellow shade and a green shade.


How can I prevent posts with no title showing up in my query?

How do I prevent posts with no title showing up in my query / loop ? ( I am doing aside, quote etc post-formats and I want to exclude title less posts from one particular loop) I have nothing on this. I searched through `WP_Query` on this but I can't find anything, and when I try google everything is muddied with 'not display title stuff' etc. Is it possible?


Master Site for specific taxonomy in MultiSite

I want to create "city" taxonomy in all sites of MultiSite. But i want to show same listing in every blog and i want to edit it from only master site and not letting other blog owners edit it. I think only solution for this is setting a master site for specific taxonomy in MultiSite. So when someone try to use "city" taxonomy from other blogs, they will see master site's city list. How can i do that?               <?php     $master_site = 1;     ...when city taxonomy need:     switch_to_blog( $master_site );     ...use list of "city" taxonomy"...     restore_current_blog();


How to control who can view certain pages in BuddyPress?

I would like to control who can see a page in BuddyPress and restrict anyone else from accessing it. Something along the lines of the following pseudocode:               <?php if ( loggedin_user_ids==1,4,5,7 ) { ?>     // Show page     <?php } else { ?>     // "You are not allowed to view this page" message     <?php } ?>      So basically, I need:   1. To be able to **control who can see the page** , not just any logged in user.   2. I also need to **control which pages this applies to** , not just any page. I am new to BuddyPress so I don't know **which functions and variables to use** here. I imagine something like this could be done in the template files, or maybe in the _bp-custom.php_ file. **Or is there a better solution to this?**


Is Timthumb still broken? What security measures should be taken?

A client has requested we use a theme, and that theme has a Timthumb dependency. I know that there has been some serious vulnerabilities in the past, but what is the current state of that plugin? Can someone point me to an authoritative resource that addresses this vulnerability? It doesn't appear that the plugin is still being maintained / available in the repo? Thanks


No first_name or user_firstname property in WP_User object

I'm writing a basic plugin. Here's my code:               $new_user = get_userdata($user_id);          $first_name1 = $new_user->user_firstname;     $last_name1 = $new_user->user_lastname;         echo "<" . $first_name1 . $last_name1 . ">";         //returns: <>          $first_name2 = $new_user-first_name;     $last_name2 = $new_user->last_name;         echo "<" . $first_name2 . $last_name2 . ">";         //returns: <>      According to the codex, this should work, but when I echo `$first_name` or `$last_name` they're empty. Strangely, _THIS_ does work:                   $id = $new_user->ID;      Am I doing something wrong? UPDATE: I `var_dump`ed `$new_user` and those properties aren't in there! Is this because I'm calling it from inside a plugin in the /mu-plugins directory? Do those properties get added later?               object(WP_User)#334 (7) { ["data"]=> object(stdClass)#330 (10) { ["ID"]=> string(3) "758" ["user_login"]=> string(7) "emerson" ["user_pass"]=> string(34) "$P$BB2PuvRbyGUSVZR1M8FLSujPvMO2MW0" ["user_nicename"]=> string(7) "emerson" ["user_email"]=> string(16) "123esl@gmail.com" ["user_url"]=> string(0) "" ["user_registered"]=> string(19) "2012-08-17 01:03:27" ["user_activation_key"]=> string(0) "" ["user_status"]=> string(1) "0" ["display_name"]=> string(7) "emerson" } ["ID"]=> int(758) ["caps"]=> array(1) { ["subscriber"]=> string(1) "1" } ["cap_key"]=> string(15) "wp_capabilities" ["roles"]=> array(1) { [0]=> string(10) "subscriber" } ["allcaps"]=> array(15) { ["read"]=> bool(true) ["level_0"]=> bool(true) ["read_questions"]=> bool(true) ["read_answers"]=> bool(true) ["publish_questions"]=> bool(true) ["immediately_publish_questions"]=> bool(true) ["publish_answers"]=> bool(true) ["read_private_forums"]=> bool(true) ["publish_topics"]=> bool(true) ["edit_topics"]=> bool(true) ["publish_replies"]=> bool(true) ["edit_replies"]=> bool(true) ["assign_topic_tags"]=> bool(true) ["access_s2member_level0"]=> bool(true) ["subscriber"]=> string(1) "1" } ["filter"]=> NULL }


How do I change my permalink structure to a custom structure on an established blog?

I've got a blog that's about 15 months old with around 160 posts. Right now my permalink structure looks like this (example): http://collegeinfogeek.com/2011/08/how-to-build-the-ultimate-hanging-loft-bed/ I'd like to change my structure so that I can custom-define all the links and not include the dates. For example, the link above would be changed to something like: http://collegeinfogeek.com/hanging-loft-bed/ How would you guys recommend going about this change without getting hurt in the SEO department? I'm guessing I need a way to generate 301 redirects.


Empty comments field or <15 characters

I would like to hide/lock the submit button to prevent comments with 15 characters or less   for subscriber and contributers in the comment section below postings/pages.   It should automaticly be visible/unlocked as soon there is an input of >15 characters.   (Prevents also _(if possible at all)_ sending users to the error page if there is no input at all)   Having a max of 500 characters and then a lock on the submit btn when there are to many characters would also be nice.   _(Research show options for minimum characters but result in sending to the so named   error page of Wordpress. Possible that my research wasn't correct, if so, sorry.)_


Shared hosting, multiple sites, can't log in to WP due to .htaccess redirection

I've got a shared hosting account with 3 separate domains on it. Each site is in its own directory, so via .htaccess there is a rewrite for each domain name to the corresponding folder. When I try to log in to WP, the redirect URL that shows up in the address bar has the domain's folder in it. Ex: www.domain1.com is under folder /domain1 Login redirect after login is `http://www.domain1.com/wp- login.php?redirect_to=http%3A%2F%2Fwww.domain1.com%2Fdomain1%2Fwp- admin%2F&reauth=1` So it just brings me back to the login screen with no error message or anything...if I reset the password, however, I can log in successfully. But upon logout I get in the redirect loop again. EDIT - this code is in .htaccess located in `/public_html/`. There is also another .htaccess inside `/public_html/domain1/` with the standard Wordpress lines.               RewriteEngine on          RewriteCond %{HTTP_HOST} ^(.*)domain1.com$ [NC]     RewriteRule ^(.*)$ /domain1/$1 [L]          RewriteCond %{HTTP_HOST} ^(.*)domain2.com$ [NC]     RewriteRule ^(.*)$ /domain2/$1 [L]          RewriteCond %{HTTP_HOST} ^(.*)domain3.com$ [NC]     RewriteRule ^(.*)$ /domain3/$1 [L]


What is the most efficient way to manage changes my product comparison tables?

I have a site that features tables comparing products over hundreds of pages. Many of these products appear multiple times and I originally made these tables static, and now need a more efficient way to manage them. For example, if 'Product 1' has a change in price, I'd like to just have it so I can edit the price and it will reflect it in all tables featuring 'Product 1' across the site. I can already think of some solutions such as custom post types, taxonomies and PHP, but I was hoping to get some insight and suggestions from others before I invest into another inefficient management method.


jquery script not enqueued in child theme

I need a little bit of insight here with the following problem? I've created a child theme called 'test_child' which I am trying to extend in the following way: This is the test_child/functions.php file:               <?php          function load_flaticon() {         wp_enqueue_script(                 'flaticon', get_stylesheet_directory_uri() . '/js/flaticon.js', array('jquery')         );     }     add_action( 'wp_enqueue_script', 'load_flaticon' );          ?>      Then, this is the test_child/js/flaticon.js file:               jQuery(document).ready(function($) {         $("a[href$='.pdf']").addClass('flaticon-pdf19');         $("a[href$='.ppt']").addClass('flaticon-ppt');         $("a[href$='.pptx']").addClass('flaticon-pptx2');         $("a[href$='.doc']").addClass('flaticon-doc2');          $("a[href$='.docx']").addClass('flaticon-docx');          $("a[href$='.xls']").addClass('flaticon-xls1');         $("a[href$='.xlsx']").addClass('flaticon-xlsx');       });     // by the way have already tried the " .ready(function() { " version      Inside the test_child/header.php I can see somewhere the line:               <!-- wp_head() -->     <?php wp_head();?>      I believe I'm doing it 'by the book' (and I have studied other similar questions), but then again, there must be something I miss, because the script is not enqueued after all... Could you please lend a fresh pair of eyes?


Wordpress function to add text

I m using this simple function to add text to my wordpress site post !               add_filter( 'afip_new_post_content', 'myprefix_change_afip_post_content', 10, 2 );     /* Grabs the image source for the newly created image and inserts it     * into the new post content along with a one line paragraph. */     function myprefix_change_afip_post_content( $post_content, $attachment_id ) {          $my_uploaded_image = wp_get_attachment_image_src( $attachment_id );     $post_content = '
This is my new uploaded image....
';     return $post_content;      I'm trying to add the title , the author and the date to               $post_content = '
This is my new uploaded image....
';      How do i insert wordpress post title , post author and the date to the above text Like               $post_content = ‘This post – $post_title() ; is uploaded by the_author() on the_time() on category the_category()


Posts-to-Posts: Retrieving a list of connected posts based on a single post ID

In attempting a custom Query using P2P's query vars I'm struggling to get anything back that makes sense. My end goal is a list of videos that are connected to a single event. My connection:               p2p_register_connection_type( array(         'name'        => 'event_videos',         'from'        => 'video',         'to'          => 'event',         'cardinality' => 'many-to-one',         'sortable'    => 'any',     ) );      I have an event (58059) connected to a single video (61427). I am attempting to retrieve all videos connected to the event 58059. I'm using this code to test the query:               require_once 'wp-load.php';          $q = new WP_Query( array(         'connected_items' => 58059,         'connected_type' => 'event_videos',         'post_type' => 'any',     ) );          if ( $q->have_posts() ) {          echo '
';              while ( $q->have_posts() ) {                  $q->the_post();                  echo '
' . get_post_type( get_the_ID() ) . ': ' . get_the_ID() . '
';              }              echo '
';          }          else {         echo 'No posts.';     }      This results in "No posts." which is unexpected. I expect a list with one item - the ID of my single linked video 61427. I've tried these variations for query args;               'connected_items' => 58059,     'connected_direction' => 'from',     'connected_type' => 'event_videos',     'post_type' => 'any',      ...and changing connected_direction to "to" and "any" produces the same result.               'connected_direction' => 'from',     'connected_type' => 'event_videos',     'post_type' => 'any',      The above produces a list of events, but changing 'connected_direction' to 'to' produces _no_ results, which makes me think there is something wrong with one side of the connection. Worth nothing is that when I hook pre_get_posts and dump the query there are three queries performed; the first with post_type set to all, the second set to 'video' and the third to 'event'. That second query includes 'post__in' with 58059 as the value, which clearly isn't going to work. You can see that on pastebin.


How many users can WordPress handle?

I want to design a member login site in WP but I have a doubt that is WordPress can handle more than 40000 users on same database? I am not sure about this so I am stooping my work here. So please help me if anyone know exactly about this to proceed my project with WP.


How do you allow users tag a photo

I have created a collectible site and want to allow registered users tag a photo and add it to "Have List" a "Wish list" or a "Want list". I would like for the user to be a ble to see the photos they tagged in their profile. Can someone please point me in the right direction with code, plugins...etc.


How to remove specific tag from multiple posts?

I am trying to find a method to delete a certain tag, that is used in my theme to display differently "featured" and "dont-miss" posts, from multiple posts and I was not able to find a solution. Or the only solution that I found is quick-edit each post manually. I know that adding bulk tags to posts is supported directly within Wordpress, but is there also the possibility to bulk remove ta tag? Do you have a semi- automatic alternative?


formatting the way posts show up

I recently installed the _plugin List Category Posts_ so that my categories show up on the correlating pages. It worked great, only it modified they header size, font, and added a horizontal scrollbar instead of wrapping the text to the next line. Example page If you click on the header link and go directly to the post, you'll see what it should look like. I'm new to wordpress and not sure how to change the post formatting back to 'normal'. Any advice would be a great help. Thanks!


Using meta_query, how can i filter by a custom field and order by another one?

With the following code (in functions.php) my posts (of CPT event) are ordered by _end_date instead of _start_date. What's the proper solution to this as of WP 3.1.3? Of course I'd like to avoid using deprecated `meta_key`.               add_filter( 'pre_get_posts', 'my_get_posts' );     function my_get_posts( $query ) {     if ( is_home() ) {       $query->set( 'post_type', 'event' );       $query->set( 'meta_key', '_start_date' );       $query->set( 'orderby', 'meta_value_num' );       $query->set( 'order', 'ASC' );       $query->set( 'meta_query', array(                                        array(                                              'key' => '_end_date',                                              'value' => time(),                                              'compare' => '>=',                                              'type' => 'numeric'                                             )                                        )                                   );       }       return $query;     }


Adding a badge to new blog post titles

I wish to add a small icon/badge left to my blog post titles those are new (maybe 5-7 days ago). I may preferably have a blinking gif image for this. Now, how to execute this? First I tried with this which I got from a WP forum post.               add_filter( 'post_content', 'addBadge2Title' );     function addBadge2Title(){         $seconds = strtotime( "now" ) - strtotime( get_the_date( "Y/m/d" ) );         $badge= get_stylesheet_directory_uri().'/library/images/new_ribbon.gif';         if ( $seconds < 10950400 ) {             echo '<img class="new_ribbon" width="75"  height="75" src="'.$badge.'" >';         }     }      But nothing shows up. Code resource : http://wordpress.org/support/topic/plugin-to-add-a-new-badge- to-title-1?replies=3#post-2499846


Merge posts plugin?

Does anyone know of a plugin that is capable of merging the post meta from one post into another? I'm working on re-releasing the Driftwood contact manager theme and I'm trying to find a way to solve the duplicate contact issue. Obviously this question could impact far more people than just myself. :)


Errors in Add Image Popup, Media Library Tab: "in_array() expects parameter 2 to be array, null given in wp-includes/query.php"

I am getting errors like               Warning: explode() expects parameter 2 to be string, array given in /data/www/ae/wp-includes/query.php on line 2390     Warning: in_array() expects parameter 2 to be array, null given in /data/www/ae/wp-includes/query.php on line 2399     Warning: in_array() expects parameter 2 to be array, null given in /data/www/ae/wp-includes/query.php on line 2399     Warning: in_array() expects parameter 2 to be array, null given in /data/www/ae/wp-includes/query.php on line 2399     Warning: in_array() expects parameter 2 to be array, null given in /data/www/ae/wp-includes/query.php on line 2399     Warning: in_array() expects parameter 2 to be array, null given in /data/www/ae/wp-includes/query.php on line 2399     Warning: in_array() expects parameter 2 to be array, null given in /data/www/ae/wp-includes/query.php on line 2399     Warning: in_array() expects parameter 2 to be array, null given in /data/www/ae/wp-includes/query.php on line 2399     Warning: in_array() expects parameter 2 to be array, null given in /data/www/ae/wp-includes/query.php on line 2399      Whats wrong?