wordpress Search function is not working

My wordpress Website Version is 2.8.1,This is the Custom wordpress website done by 2 years ago.[Link Removed... i got Solution][1]Now Search functionality is not working(It was working well earlier.) My Client told **Don't Upgrade the Version**. so here we need to replace the old search function with newer Search function. My **searchform.php**                <form method="get" id="searchform" action="<?php bloginfo('url'); ?>/" style="padding-bottom:30px;">     <input type="search" value="search..." name="s" id="s" class="inputbox" onblur="this.value='search...';" onfocus="if(this.value=='search...') this.value='';" /> <input type="submit" id="searchsubmit" value="" />     </form>      There is no more Files like " **search.php"** . I don't know how to replace the older search function with newer one.So please any one guide me. or any search plugin is do this work. Thanks in advance. This Thread is Closed...


How do I reliably find a URL to a script or other file?

I have the method below to try and build a URL for a script I wish to load:               class WPSM_SuperMail {              public static function scriptUrl($scriptPath) {             return plugin_dir_url ( __FILE__ ) . '/js/' . $scriptPath;         }     }      However, the `WPSM_SuperMail` class is located in the _code_ sub-folder of my plugin, and this folder is a sibling of my _js_ sub-folder. How can I find my plugin base folder and sub-folders of that without the damned 'code' intrusion?


Is there an action_filter hook to add content before the post title?

I am looking to add content before the post title but not included in the markup of the title itself so adding to `the_title` doesn't seem to be the right hook for this. Thanks


galleria for WordPress not working properly on Mobile devices (responsive)?

I am using galleria.io plugin for WordPress to create photo gallery, it works fine and is perfect for my requirement, the only issue is that it creates a huge space between the image and thumbnail when seen on mobile devices - (responsiveness not working) due to the fact that it takes fixed width. I did try working out with @media css but its not the best solution - i hope someone out there has some JS to fix this ? Thanks


How can I activate Collapse Menu in WordPress?

Inside the WordPress admin dashboard there is a button for making the left side menu collapse (to show just icons and not the icons + text on left side). How can I add jQuery so that it gets automatically collapsed once my plugin opens up. I tried this but it didn't work for me. I want to give a sort of 'full screen' option inside dashboard. Can anyone help me on this? I tried adding this jquery script to make it work, but it didn't work for me:               <script>     jQuery(document).ready(function() {          jQuery("#collapse-menu").click();     });


WP-nivo-slider Producing Error "Cannot modify header information - headers already sent by ..."

I have installed the wp-nivo-slider and am now getting a list of these errors on my /wp-admin/ page. The error is:               Warning: Cannot modify header information - headers already sent by (output started at /html/wp-content/plugins/wp-nivo-slider/wp-nivo-slider.php:633) in /html/wp-login.php on line 354      Any ideas?


how to assign a status/mark to post?

I want to mark some posts to include them in a featured content slider. For that purpose, I want to include a check box on the new post page, so that if the checkbox is selected the post is marked as featured. Then I can display all marked posts in the slider. How this can be done? Thanks.


Custom Archive Page

I want to create a custom archive page. It will look like this: 2011 January February March April May June... (Months) May (Current Month)   * Post 1   * Post 2   * Post 3 ... And clicked one of months (`is_month()` page) it will be look like this : 2011 (Selected Year) January February March April May June... (Months) April (Selected Month)   * Post 1   * Post 2   * Post 3 ... I tried to solve this by using `wp_get_archives();` but it's insufficient for this situation. Anyone got some ideas? Thanks! Wordpress version is 3.1


Simple foreach loop help needed in wordpress "the loop"

I need a foreach loop inside "the loop" **This is my current code (index.php) :**               <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink(); ?>"  title="<?php get_the_title(); ?>"> <?php the_title(); ?>

Show tags

Popup contents goes here (tags)
     <?php endwhile; ?>     <?php else : ?>     <?php endif; ?>      It lists post title and tags in the index php. I display all my tags in a pop up box. User should click "show tags" link to view the tags. Popup doesn't work correctly when i have more than 1 post. Because i need a unique name for each popup. I mean instead of "modal-from-dom" for all i need like "modal-from- dom-1,modal-from-dom-2,etc" I tried the following code but its not working.               <?php if (have_posts()) : while (have_posts()) : the_post(); ?>      <?php $modalcount = 1; ?>
<a href="<?php the_permalink(); ?>"  title="<?php get_the_title(); ?>"> <?php the_title(); ?>

<a data-backdrop="true" data-controls-modal="modal-from-dom-<?php echo $modalcount; ?>" href="#">Show tags
         <div id="modal-from-dom-<?php echo $modalcount; ?>">Popup contents goes here (tags)
     <?php $modalcount++; ?>         <?php endwhile; ?>         <?php else : ?>         <?php endif; ?>      Can anyone help me?


Wordpress comments and Facebook comments

I've just installed Wordpress for a travel blog. I want the visitors to be able to comment with their facebook account or sign up as a subscriber to the blog (my mom for example doesn't have facebook). I installed the "Facebook Comments for WordPress" plugin but the problem is that now the visitors can either comment at the Facebook comments or the original comments. I want them to merge so that you comment in one place but you can either login to the blog or login to facebook to comment. Anyone know if this is possible without me needing to develop?


Unable to set Custom "Link URL" for Featured Image, and More?

I have an issue that I believe can be solved one of two ways. I am using Featured Images in posts for content on a home page slider. What I would like to have happen is to have the destination links on click to be custom. Not the post or image URL of the post/featured image being used to feed the slider. 1) I thought I might be able to use the Image URL feature on the image itself, but it turns out the Featured Images will not accept a custom URL. It defaults back to the image path. 2) I have tried using a custom Post Meta field, but my attempts to retrieve that meta have been unsuccessful. I have set a Meta Field with the name "slider-url" and have dropped the path to the desired destination page into the field. I am then using the following code in the loop for the slider (from the WP Codex) in an attempt to pull that value into the href="" `<?php echo get_post_meta($post->ID, "slider-url", true); ?>` I am hoping someone might either have a hack for the Featured Image "Image URL" (along with a way to retrieve that URL), or alternately some insight into why my custom post meta might not be working. Thanks in advance for your time and expertise. Cheers! EDIT: Here's the specific block of code. It's contained within the PHP file of the slider plugin.
     <?php          $category = get_option('wpns_category');         $n_slices = get_option('wpns_slices');     ?>     <?php query_posts( 'cat='.$category.'&posts_per_page=$n_slices' ); if( have_posts() ) : while( have_posts() ) : the_post(); ?>         <?php if(has_post_thumbnail()) : ?>         <a href="<?php echo get_post_meta($post->ID, "slider-url", true); ?>" title="<?php the_title(); ?>">              <?php the_post_thumbnail(); ?>                  <?php endif ?>         <?php endwhile; endif;?>         <?php wp_reset_query();?>
      Additionally, here's a screen capture of the post meta field: http://s.sct.io/Bl6O Thanks again!


Custom Taxonomy with Custom Post Type Finds No Posts

I've created a custom post type named `mfg_ppn` and a custom taxonomy called `mfg_pp`, and they are referenced as `$this->cpt_promotion_news`and `$this->cpt_promotion`in case you were wondering about them. Everything looks good in the admin, and I can easily assign the taxonomy to the custom posts. But when I visit my site using `http://example.com/promotion/company` I do not get any posts, even though there are 12 posts bound to that particular term. Here is my PHP code used for registering the post type:               // Register campaign news:     register_post_type($this->cpt_promotion_news, array(         'labels' => array(             'name' => __('Campaign Posts', $this->plugin_locale),             'singular_name' => __('Promotion Campaign', $this->plugin_locale),             'menu_name' => __('Promotion', $this->plugin_locale),             'all_items' => __('All Campaign Posts', $this->plugin_locale),             'add_new' => __('Add New Post', $this->plugin_locale),             'add_new_item' => __('Add New Campaign Post', $this->plugin_locale),             'edit_item' => __('Edit Post', $this->plugin_locale),             'new_item' => __('New Post', $this->plugin_locale),             'view_item' => __('View Post', $this->plugin_locale),             'search_items' => __('Search Posts', $this->plugin_locale),             'not_found' => __('No posts found', $this->plugin_locale),             'not_found_in_trash' => __('No posts found in trash', $this->plugin_locale),             'parent_item_colon' => __('Post parent:', $this->plugin_locale)         ),         'description' => __('News for a partner promotion campaign.', $this->plugin_locale),         'public' => true,         'exclude_from_search' => true,         'show_in_nav_menus' => true,         'menu_position' => 25,         'show_in_menu' => true,         'map_meta_cap' => true,         'capabilities' => array( 'manage_options' ),         'capability_type' => 'post',         'hierarchical' => false,         'supports' => array( 'title', 'editor', 'thumbnail', 'comments' ),         'taxonomies' => array( $this->cpt_promotion ),         'has_archive' => true,         'rewrite' => array(             'slug' => __('promotion-post', $this->plugin_locale)         )     ));      And here is the code for registering the taxonomy:               // Register promotion campaigns:     register_taxonomy($this->cpt_promotion, $this->cpt_promotion_news, array(         'labels' => array(             'name' => __('Promotion Campaigns', $this->plugin_locale),             'singular_name' => __('Promotion Campaign', $this->plugin_locale),             'menu_name' => __('All Campaigns', $this->plugin_locale),             'all_items' => __('All Campaigns', $this->plugin_locale),             'edit_item' => __('Edit Campaign', $this->plugin_locale),             'view_item' => __('View Campaign', $this->plugin_locale),             'update_item' => __('Update Campaign', $this->plugin_locale),             'add_new_item' => __('Add New Promotion Campaign', $this->plugin_locale),             'new_item_name' => __('New Campaign Name', $this->plugin_locale),             'parent_item' => __('Post parent:', $this->plugin_locale),             'parent_item_colon' => __('Post parent:', $this->plugin_locale),             'search_items' => __('Search Campaigns', $this->plugin_locale),             'add_or_remove_items' => __('Add or Remove Campaigns', $this->plugin_locale)         ),         'public' => true,         'show_ui' => true,         'show_in_nav_menus' => false,         'show_tagcloud' => false,         'show_admin_column' => true,         'hierarchical' => true,         'query_var' => true,         'rewrite' => array(             'slug' => __('promotion', $this->plugin_locale)         )     ));      I have also created a template called `taxonomy-mfg_pp`, which is the name of the taxonomy, but it never outputs any post, even though there are posts. The culprit seems to be that the WP_Query executed only looks for posts, pages and attachments, as seen below:               SELECT SQL_CALC_FOUND_ROWS  qADrathuFrU2_posts.ID FROM qADrathuFrU2_posts  INNER JOIN qADrathuFrU2_term_relationships ON (qADrathuFrU2_posts.ID = qADrathuFrU2_term_relationships.object_id) WHERE 1=1  AND ( qADrathuFrU2_term_relationships.term_taxonomy_id IN (1196) ) AND qADrathuFrU2_posts.post_type IN ('post', 'page', 'attachment') AND (qADrathuFrU2_posts.post_status = 'publish' OR qADrathuFrU2_posts.post_author = 1 AND qADrathuFrU2_posts.post_status = 'private') AND qADrathuFrU2_posts.post_password = ''  GROUP BY qADrathuFrU2_posts.ID ORDER BY qADrathuFrU2_posts.post_date DESC LIMIT 0, 10      Am I doing something wrong and am I going about this the wrong way? Please help me as the deadline is approaching and I just can't seem to get this right! Thanks in advance, Jonathan


Custom Post Type & Custom Menu Walker to append custom class for active post types

I have an interesting problem I am trying to solve here regarding a custom nav menu. Essentially, I have created a custom walker class for my nav menu and I have manually added a menu entry directing users to "/articles" which is a custom post type archive page. (BTW, as far as I know there is no way to have these custom post type archive pages included within the left hand selection correct?) Anyway... so, I have added the menu entry by using the custom link dialog box and my custom walker correctly highlights that nav menu entry when you click it/visit the "/articles" page. The problem I am having here is that when you select one of the news items this "/articles" menu link is no longer selected. So the question here is: what would I need to change in my custom walker class (code I am using is included below) to append a class to the menu when your on of those post pages. It would seem to me that this functionality should be built into wordpress for custom post types. For example, the class "current_page_parent" is appended to a parent page if you visit one of the subpages. I thought there would be something like "current_post_parent" or "current_custom_post_parent" but this does not seem to exist as far as I can tell. So team, any idea how I can add this functionality? **My Custom Walker Menu**               // COMPANY - RIGHT MENU - CUSTOM MENU WALKER     class Company_Menu_Bar_Walker extends Walker_Nav_Menu {     function start_el(&$output, $item, $depth, $args) {         global $wp_query;         $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';         $class_names = $value = '';         $classes = empty( $item->classes ) ? array() : (array) $item->classes;         $current_indicators = array('current-menu-item', 'current-menu-parent', 'current_page_item', 'current_page_parent');         $newClasses = array();         foreach($classes as $original_class) {         //check if it's indicating the current page, otherwise we don't need the class             if (in_array($original_class, $current_indicators)) {                 array_push($newClasses, $original_class);             }         }         $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $newClasses), $item ) );         if($class_names!='') $class_names = ' class="'. esc_attr( $class_names ) . '"';         $output .= "\t" . '
';         $attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';         $attributes .= ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';         $attributes .= ! empty( $item->xfn )        ? ' rel="'    . esc_attr( $item->xfn        ) .'"' : '';         $attributes .= ! empty( $item->url )        ? ' href="'   . esc_attr( $item->url        ) .'"' : '';         if($depth != 0) {         //option to store things like sub-menus         }         $item_output = $args->before;         $item_output .= '';         $item_output .= $args->link_before .apply_filters( 'the_title', $item->title, $item->ID );         $item_output .= '';         $item_output .= $args->after;         $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );     }     }      **Template Code which calls the custom walker***
     select a page     <?php wp_nav_menu( array(     'theme_location'    => 'company-menu',     'container'         => '',      'container_class'   => '',      'container_id'      => '',     'menu_class'        => '',     'menu_id'           => '',     'echo'              => true,     'before'            => '',     'after'             => '',     'link_before'       => '',     'link_after'        => '',     'fallback_cb'       => '',     'items_wrap'        => '
' . "\n" . '%3$s
' . "\n",     'depth'             => 2,     'walker'            => new Company_Menu_Bar_Walker     ));      ?>


Yoast's WordPress SEO plugin is not showing the correct snippet

I am facing a problem. I am not getting the snippet which YOAST plugin showed me. The snippet in Google search is different from what YOAST is showing. Check out the screenshots (http://imgur.com/a/ko5lQ). Let me know what is the solution of it?


Wordpress search not searching pages' content

My wordpress site doesnt search for pages' content. I have checked for the existence of the following filter that could prevent search from searching pages but there aint any               add_filter('pre_get_posts','myfunction');       What else could I check for? Any help would be appreciated. Regards, Loveleen


403 Forbidden error when using the wp_login_form function

I use the function wp_login_form twice in my site for a simple client login. However, suddenly the problem started and every time I use it I receive this 403 forbidden error. My .htacess looks like so:               # BEGIN WordPress     <IfModule mod_rewrite.c="">     <files async-upload.php="">     SecFilterEngine Off     SecFilterScanPOST Off     </files>     </IfModule>     <IfModule mod_rewrite.c>     RewriteCond %{HTTP_HOST} !^$     RewriteCond %{HTTP_HOST} !^www\. [NC]     RewriteCond %{HTTPS}s ^on(s)|     RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]          RewriteCond %{SERVER_PORT} 80      RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]          RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress      The problem is weird because if I access it directly without using the form inside the site it works just fine. What am I doing wrong? Thank you.


get recent comments of a particular category

I am using `get_comments('status=approve&number=5')` to display recent comments in my wordpress sidebar. I need to display the recent comments of a particular category. How to do this?


Visual Form Builder - Email Content?

Looking for a way to easily edit the email content for VFB Pro ... Reason being, I have a really long form, that gets printed, but all fileds are not alway populated, so when I am printing the email, it is a lot of wasted paper. Would be great to be able to edit so that the email only sends the populated fields. Anyone?


Theme title in admin shows full path

For some reason my admin panel seems to be a little busted. My themes title (Smashing Themes: Tank) now shows up as the full path of the theme instead of just he title. Kinda weird and a little annoying. It shows up in multiple browsers. ![bug](http://i.stack.imgur.com/obBpA.png)


I Need To Display A Specific Product (Called By Meta Field) On It's Current WooCommerce Category Page

I am trying to build a little module onto the product-archive template for WooCommerce that will accomplish one goal. I have included custom meta fields on the category editor page so that I can paste in specific product SKUs on that page to have as Featured Products. However, I need to figure out a way to have WooCommerce query the current category of products and list the product that has the same SKU that I have listed in the category meta. in other words... Product Category -> Custom Meta Field (Product Sku) -> On Product Category Page, Display Product With Matching SKU from current category. Is something like this even possible? I have been wracking my brain for hours trying to get this to work. Honestly, it doesn't seem like that crazy of an idea, but there is just nothing available that I can with a bit of guidance in the correct direction.


Show language translation for custom page

I am using qtranslator plugin for multilingual functionality. It all working. But I want to know how to translate and add language contents for my custom pages, where I am showing data from database, like listing of companies from my custom table. Dynamic data is OK, that's from database. but how to change grid column & other labels here ? Any help please. Thanks in Advance.


Will permalinks work if blog is transferred to subdirectory?

How should I transfer my WordPress blog from the root of my domain to a sub- directory? If everything including root in an installment of WP 3.2.1 were moved to a sub-directory, would the default permalink structure update to it? e.g. `domain.com/wp-sub` instead of `wp-domain.com`? Also, should I modify any code or settings and, if so, what exactly?


How to return an array of posts with the comments template intact for each post

Has anyone run across a way to build a page of posts that includes the comments and discussion form(s) for each post inline with the list? I tried this a few ways today and found it quite difficult. For example the list would be pseudo-code like               POSTS ARRAY     POST[1]     COMMENTS ARRAY      POST[2     COMMENTS ARRAY     ...      One of the ways I tried to accomplish this (which seemed the easiest really) was to use `single.php` as a page template and then just run a manual query_posts in it. I was able to get it to work by calling `comment_form('', the_ID());` instead of `comments_template( 'comments.php', true );` HOWEVER that solution does NOT use my comments template and rather throws this `div` in there with an `id` of "respond" that isn't anywhere in my theme. There is some magic that happens on a page or single that you can't easily override when you try to do it in one big list. Any help would be appreciated and respected.               /*     Template Name: Blog     */     ?>     <?php           get_header();          $args = array(     'category' => '7',     'posts_per_page' => '10',     );     query_posts( $args );          ?>
     <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>         <div id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>

<a href="<?php the_permalink() ?>" title="<?php        the_title(); ?>" rel="bookmark"><?php the_title(); ?>
                 <?php edit_post_link('Edit this entry','',''); ?>                 <?php if ( has_post_thumbnail() ) { /* loades the post's featured thumbnail, requires Wordpress 3.0+ */ echo '
'; the_post_thumbnail(); echo '
'; } ?>
                     <?php the_content(); ?>                     <?php wp_link_pages('before=
&after=
'); ?>

                     Posted on <?php the_time('F j, Y'); ?> at <?php the_time() ?>

                     <?php the_tags('Tags: ', ', ', ' '); ?>

                     Receive new post updates: <a href="<?php bloginfo('rss2_url'); ?>" rel="nofollow">Entries (RSS)
                     Receive follow up comments updates: <?php comments_rss_link('RSS 2.0'); ?>

                  <?php /* If a user fills out their bio info, it's included here */ ?>
                        <?php          comment_form('', the_ID());         //comments_template( 'comments.php', true ); ?>          <?php endwhile; /* end loop */ ?>


can you set a default value to a custom field

I'm looking to set a default value to a specific custom field, in case the client doesn't add into the custom field it already has a specific number associated with it. one step deeper, I'd like it so if cat =22 is selected this custom field is automatically added into the post with a default that hopefully the client will add the proper number I think this can be accomplished by a global function but my brain is just not processing this right now


How to keep plugin translates after updates?

http://wordpress.org/extend/plugins/bbpress/ bbpress' language folder ( wp- content/plugins/bbpress/bbp-languages ) have that warning:               /**      * Do not put custom translations here. They will be deleted on bbPress updates.      *      * Keep custom bbPress translations in /wp-content/languages/      */      Actually this is not a new problem and yes they are right. This is big problem if you are using wordpress plugins with a non-english language. Basically i translated bbpress and created .po and .mo files. Files are working if i put them in their normal wp-content/plugins/bbpress/bbp-languages folder. But as above warning says that will delete when update. But problem is, translating is not working if i put them in wp-content/languages/ folder as suggested in bbpress. I think there must be a hook or something i can activate it but what is best solution for it? Simply i want to keep plugin language files in wp- content/languages/


Not showing list if there aren't any categories to display

maybe you can help: Bellow there is a simple code listing my blogs categories. **I need some code that will not display the * _ul** is there aren't any categories to display_*

Categories:

     <? $master_cat = get_category_by_slug('Master');        $master_cat_id = $master_cat->term_id;         $slave_cat = get_category_by_slug('Slave');        $slave_cat_id = $slave_cat->term_id;        wp_list_categories('orderby=name&title_li=&exclude='.$master_cat_id.','.$slave_cat_id.''); ?>
      Ty very much


retrieve post data and insert it in seperate static html page without Wordpress

I have a blog which runs on Wordpress and inside the Wordpress environment I'm fine and know how to display specific blogposts etc. But beside I want to insert specific Blog-posts in a static HTML Website which doesn't have a CMS and is standalone. Imagine the simplest case of               <body>      <p class="blogpost"> <!-- insert specific blogpost of my blog on static website --> </p>     </body>      is there any possible chance to retrieve a blogpost of Wordpress by PHP without running the site on Wordpress? Any clue how to start with?


Pagination doesn't work

I created myfile.php with the following content:               global $paged;     if ( get_query_var( 'paged' ) ) {         $paged = get_query_var( 'paged' );     } else if ( get_query_var( 'page' ) ) {         $paged = get_query_var( 'page' );     } else {         $paged = 1;     }          $args = array(         'post_type' => array('my_custom_post_type'),         'paged' => $paged,         'posts_per_page' => 3,         'ignore_sticky_posts' => 1     );          $wp_query = new WP_Query( $args );     var_dump($wp_query);     if($wp_query->have_posts()) :         while($wp_query->have_posts()) : $wp_query->the_post();             // show post         endwhile;     endif;          next_posts_link('Next posts');          wp_reset_query();     wp_reset_postdata();      and:   * when it's set to "Static Front Page" in Settings > Reading it works fine with pagination. I can access http://example.com/page/2   * when Settings > Permalinks is set to "Default Permalinks Structure" it works with http://example.com/?page_id=1234&paged=2   * when Settings > Permalinks is set to any "Custom Structure" the following http://example.com/mypage/page/2 launches 404.php. I have no idea what am I missing here but I just tried every single suggestion from troubleshooting guide on this page: https://codex.wordpress.org/Pagination \- they suggest that "404 - not found" is one of the common problems when the permalinks are set to "Custom Structure" so WP developers are aware of some bug or issue but they don't say how to fix that. My server is WAMP for Windows 7 (PHP 5.4.3, Apache 2.4.2, `mod_rewrite` enabled, custom link structures work great expect pagination when "myfile.php" is used as a page other than "Static Front Page"). My .htaccess when "Custom Permalink Structure" is set to "Post name":               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /wp/index.php [L]     </IfModule>          # END WordPress      When I enter http://example.com/mypage/page/2 (doesn't work): `SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'page' AND wp_posts.post_type = 'my_custom_post_type' ORDER BY wp_posts.post_date DESC` When I enter http://example.com/?page_id=1234&paged=2 (works): `SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'my_custom_post_type' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') ORDER BY wp_posts.post_date DESC LIMIT 2, 2`


Is it possible to modify default image name suffix?

So that, I tried this technique - Modify Default Image Name Suffix but it doesn't work as I need, I have all the images loaded, and I need to regenerate them. And what about the recovery of the images? **EDIT -** What I need is have the image files named as `pic-large.jpg`, pic-medium.jpg, pic-thumbnail.jpg instead of `pic-1024x700.jpg`. I use ImageMagick engine plugin and Additional Image Sizes (zui), in order to create more sizes than the default ones.


delete fields from checkout page in woocommerce

I use woocommerce in my client site.I use Boutique theme in wordpress.i want to customize checkout page i don't want extra fields in checkout form so i delete the unnecessary fields but when i click on checkout button it show me error that"country field are required" i fill the fields but still it show me error for country,first name and last name field .i try different things but doesn't work .can any one have any solution.


BuddyPress - What Table is User Role Stored In?

Where in the MySQL tables is the User Role stored for BuddyPress / WordPress? Thanks.


custom admin thumbnail for videos, not getting post's id?

In the attachments edit page i'm trying to use the selected thumbnail instead of the default icon. 99% of the way there but i can't get the attachment's id into the function. Am i missing something obvious? Help appreciated! Dc.               function set_attachments_icon($icon, $mime = null, $post_id){         $vars = get_defined_vars();         print_r($vars);              echo " ??".$icon."?? ".$post->id.' '.$post_id.'  ?? id not getting picked up?';              $thumb_id = get_post_meta($post->ID,'dsv_thumbnail_id', true);              if($thumb_id!=''){             $image_attributes = wp_get_attachment_image_src( $thumb_id );             $icon =  $image_attributes[0];         }              return $icon;     }          add_filter('wp_mime_type_icon', 'set_attachments_icon');     apply_filters( 'wp_mime_type_icon', $icon, $mime, $post_id );


Tell wordpress to show a single page instead of an archive

So I have multiple custom parameters in the url, and at some point when the query reaches 3 parameters (e.g. `index.php?post_type=foo&<param-1>=<val-1>&<param-2>=<val-2>&<param-3>=<val-3>`) there can be either one post or none. Instead of displaying archive (`archive- foo.php`) with this one post, I want wordpress to display the post itself (e.g. `single-foo.php`). Of course I can check all of this in the `archive- foo.php` and redirect to a corresponding post from there, but in this case I "waste" the whole query of displaying the archive. So, is there any way to force wordpress load single page when archive contains only one record by manipulating the main query (using a custom function in `functions.php` and attaching it via `add_action('pre_get_posts', '<func- name>')`)? Rough example:               add_action('pre_get_posts', 'custom_func')     function custom_func($query) {         if($query->get('param-1')) {             // Change some $query params, but still show archive             if($query->get('param-2')) {                 // Change some $query params, but still show archive                 if($query->get('param-3')) {                     // There is 1 post or none for sure                     // Alter the query to something like                     $wpdb->query('SELECT * FROM wp_posts WHERE param1=val1 AND param2=val2 ...');                     // force to load a single page with the results passed to $post object                 }             }         }     }


No Thumbnails Generated

I setup WordPress on my own server and it's up and running...one thing that I have noticed is that WordPress doesn't generate any images I upload. Usually when I upload an image through WordPress it will generate a thumbnail, medium, and large sized image. WordPress installed without error and everything else is working fine. I have tried to rebuild the thumbnails, but that doesn't work :-( Any ideas? Thanks,   Josh


Add audio attachment link to RSS

This is how I'm adding a featured image to my RSS:               function featuredtoRSS($content) {     global $post;     if ( has_post_thumbnail( $post->ID ) ){     $content = '' . get_the_post_thumbnail( $post->ID, 'topImage', array( 'style' =>  'margin:0 auto; border: 1px solid #555; display:block;' ) ) . '' . $content;     }     return $content;     }          add_filter('the_excerpt_rss', 'featuredtoRSS');     add_filter('the_content_feed', 'featuredtoRSS');      All of my posts have audio attachments (one per post), and I would like to add them to RSS as well. How would I achieve that? Thanks in advance.


How can I remove "Proudly powered by WordPress" from twentyeleven without modifying footer.php?

How can I remove "Proudly powered by WordPress" from twentyeleven without modifying footer.php, and without creating a child theme? I'm looking for a php command, such as `add_action`, `remove_action`, `add_filter`, or something of that sort. I'm not looking for CSS to hide the footer. I don't want to modify any of the theme files other than `functions.php` Is this possible? For reference the code in the footer that is creating this is below.
         <?php do_action( 'twentyeleven_credits' ); ?>         <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentyeleven' ) ); ?>"         title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentyeleven' ); ?>"         rel="generator">         <?php printf( __( 'Proudly powered by %s', 'twentyeleven' ), 'WordPress' ); ?>


wp_insert_post with POST data

I found some code on this site for wp_insert_post and I got it working. I did find the post in the category where I would expect it to be. Then I changed the code example to include information from my form on the page and the code fails. Here is the sample code I got from this site that does work.               <?php if(isset($_POST['new_reservation']) == '1') {         $post_title = "My Post";         //$post_category = 'reservations';              $my_post = array();         $my_post['post_title'] = "My Post";         $my_post['post_content']  = 'This is my post.';         $my_post['post_status']   = 'publish';         $my_post['post_author']   = 1;         $my_post['post_category'] = array(9);               wp_insert_post($my_post);         //update_post_meta($post_id, 'reservations', $customer);          } ?>      so then I changed things to this in order to get the name of the post from the form               <form action="" method="post" name="reservations" id="reservations" enctype="multipart/form-data">

                 <img src="<?php bloginfo('template_directory');?>/images/name.png" alt="name" width="47" height="10" />	                 <img src="<?php bloginfo('template_directory');?>/images/date.png" alt="date" width="43" height="10" />

                 <input type="text" id="name" name="name" />	                          <input type="hidden" name="new_reservation" value="1" />
                 <input type="submit" name="reserveSubmit" id="reserveSubmit" class="button" value="submit"/>  or Clear Form

                    <?php if(isset($_POST['new_reservation']) == '1') {         $post_title = $_POST['name'];         $post_category = 'reservations';              $my_post = array();         $my_post['post_title'] = $post_title;         $my_post['post_content']  = 'This is my post.';         $my_post['post_status']   = 'publish';         $my_post['post_author']   = 1;         $my_post['post_category'] = array(9);// Insert the post into the databasewp_insert_post( $my_post );"                         wp_insert_post($my_post);         //update_post_meta($post_id, 'reservations', $customer);          } ?>      The code fails whenever I try to use the name variable as the name of the post


How to recover deleted site in Wordpress Multisite?

I went to Network Admin > Sites > clicked on a site and changed the site url for a child site. Now that site is gone altogether and I cannot get it back. What can I do now?


Is there an easy way to migrate a site from SiteFinity to WordPress?

Has anyone ever migrated a site from SiteFinity to WordPress? I've got a large (1,200+ page) site that I'm transitioning over to WordPress and I'm not looking forward to the content migration. Does anyone know of a tool, trick or plugin to make this easier?


Roles for Custom Post Types

I created some custom post types, but I would like to hide them in the dashboard from Subscribers, Authors, and Editors (essentially, just allow administrators to access them). Can I do this without installing a plugin?


Extending the site search to include a single custom field

I have the followign code in my functions.php file               function __adapted_search_function($search, $query) {       if(is_admin() || !$query->is_main_query() || !$query->is_search)         return; //determine if we are modifying the right query            global $wpdb;       $search_term = $query->get('s');       $search = ' AND (';            //point 1       $search .= "($wpdb->posts.post_title LIKE '%$search_term%')";            //need to add an OR between search conditions       $search .= " OR ";            //point 2       $search .= "($wpdb->posts.post_excerpt LIKE '%$search_term%')";            //need to add an OR between search conditions       $search .= " OR ";            //point 3       $search .= "($wpdb->postmeta.meta_key = 'mcb-product' AND $wpdb->postmeta.meta_value LIKE '%$search_term%')";            //add the filter to join, sql will error out without joining the tables to the query       add_filter('posts_join', '__custom_join_tables');                    return $search . ') ';     }          function __custom_join_tables($joins) {       global $wpdb;       $joins = "JOIN $wpdb->postmeta ON ($wpdb->postmeta.post_ID = $wpdb->posts.ID)";       return $joins;     }      Which I was hoping would search only the post title, excerpt and also a single custom field. It works if I remove the join but really need to keep that included, can anyone see where I have gone wrong?


show/hide attachments

Is there a way to **show/hide** attachments in my case images on a post. What I want is to mark an image as _"hidden"_ and then only show it to the _admin_ and hide hidden images from a normal user I know how to use `wp_query` and `get_posts` to get _attachments_ also how to check if user is an _admin_ just want to know if there is somewhere a field or table where I can store a flag that the attachment is **hidden** or if there is any _"best practice"_ for this. Essentially I have an post with attached images and I display a gallery of the images on a page as a custom post type and I want is to show the “hidden” images to the admin but not to a user lower then admin. Atm. I am using:               $args = array(     'order'         => 'ASC',     'orderby'       => 'menu_order ID',     'post_type'     => 'attachment',     'post_parent'   => $post->ID,     'post_mime_type' => 'image',     'post_status'   => null,     // Change the number of images to show in the gallery below     'numberposts'   => 999,     );     $attachments = get_posts($args);      To retrieve the attachments I tried wp_delete_attachment witch confuses me because according to * _WP documentation: *_ `function wp_delete_attachment( $post_id, $force_delete = false )` it has a parameter that does not permanently delete the attachment > bool $force_delete: Whether to bypass trash and force deletion. Defaults to > false. but when I used it as: `wp_delete_attachment( $item,false );` > `$item` being the id for the attachment it deleted the image from the uploads folder. If the `wp_delete_attachment` function works as intended I would like to know how to query the deleted attachments that are bound to the post. So that the admin user has a chance to "restore" the image Hope someone can help.


Is it posible to translate a url prefix?

I use a prefix in my url using "add_permastruct" in my functions.php:               www.mydomain.com/the_prefix/my_category/postname      But I would like to translate "the_prefix". For example, if my site is in english, I will use the prefix "articles" and If my site is in german I will use "artikel".               English: www.mydomain.com/en/articles/my_category/postname          German: www.mydomain.com/de/artikel/my_category/postname      Any ideas? I use WPML plugin


Making a plugin file accessible via url rewrite?

In my WordPress plugin I have a php file that generates some stats about the blog and outputs it as a simple text file. To access WordPress functions I've included this at the top of the file:               define('WP_USE_THEMES', false);     require(dirname(__FILE__) . '/../../../wp-blog-header.php');      Now I'd like to hide the actual URL, since it's in the wp-content/plugins directory and replace it with something nice and short:               http://example.com/wp-content/plugin/data-fetcher/list-data.php          -> rewrite to http://example.com/list-data      I added this to `.htaccess`:               <IfModule mod_rewrite.c>     RewriteEngine on     RewriteBase /     RewriteRule ^list-data$ wp-content/plugins/data-fetcher/list-data.php [L]     </IfModule>      The problem: when I access the short URL, I get a 301 Moved Permanently redirect before I end up on the page. This means that the wp- content/plugins/... URL is revealed in the browser. I suspect that WordPress is initiating this somehow. The rewrite rule works fine for images and plain php files (i.e. without WP includes/require). Is my assumption correct? How can I prevent WordPress from sending the redirect?


Creating Multiple Menus in the Thesis Theme?

How can I add three menus to the Thesis theme? I want a menu above the header image, one below the header image and one in the footer. A neat step by step instruction like this for Twenty Ten would be like the coolest answer.


How to make a share-this window drop when reaching end of post?

The following blog of okcupid had this interesting feature that shows a "share this" window only when you reach the end of the post: http://blog.okcupid.com/index.php/what-if-there-were-not-so-many-white-people/ How is it possible to do this? Thanks


Different Output for "Every Other" Foreach Statement?

I'm currently using the following code in order to get subcategories in a category page and getting the posts foreach subcategory. In the part where it echos "span-12" (line 14) i want it to echo "span-12 last" for every other subcategory. my code:               <?php  $cats = get_categories('child_of='.get_query_var('cat'));           foreach ($cats as $cat) :          $args = array(     'orderby' => 'title',     'order' => 'ASC',     'posts_per_page' => -1, // max number of post per category     'category__in' => array($cat->term_id)     );     $my_query = new WP_Query($args);               if ($my_query->have_posts()) :          echo '
';         echo '

'.$cat->name.'
';              while ($my_query->have_posts()) : $my_query->the_post(); ?>              <?php /*general loop output; for instance: */ ?>
         <a href="<?php the_permalink() ?>"><?php the_title(); ?>           aired <?php if(!function_exists('how_long_ago')){the_time('F jS, Y'); } else { echo how_long_ago(get_the_time('U')); } ?>

         <?php endwhile; ?>
         <?php else :          echo 'No Posts for '.$cat->name;                         endif;      wp_reset_query();          endforeach; ?>      In this part, (line 14)                echo '
';      i want to echo for every other category foreach, i want it to echo like this                echo '
';      I found some code for adding and checking if it is odd, but that doesn't seem to work for this code.


Custom post types and permalinks : What a mess !

I know that's a common problem with the custom-post-types, but I'm stuck there. I created a custom-post-type named 'cpt_soins'. I have no page with similar name (singular/plural)... I tried with `'rewrite' => array('slug' => 'nos-soins-et-services');` when I registered my custom post type in order to display a more pretty url than "/?cpt_soins=soins-visage-a-la-rose"... But I'm stuck with a 404 error. I want this ugly permalink: "http://localhost:8888/wordpress/?cpt_soins=soins- visage-a-la-rose" ---> transformed into: "http://localhost:8888/wordpress/nos- soins-et-services/soins-visage-a-la-rose" I know i can use the "add_rewrite_rule() with regex". But I did'nt get working. Could you give me the code please for the functions.php in order to get my permalink ? Thanks a lot


Need specific kind of "Poll Voting" for Wordpress

I'm designing a website for a client. I don't really know how I got landed with all the backend structure code, but I did. I'm not an awful programmer, but I need something solid to work off, I can't just code my own program. I need a plugin or some code that will automatically place a poll with **three** options to each post. Preferably, the OUTCOME of the poll would be displayed with the excerpt, then the actual poll would be on the full post page. That would be ideal, but I'll take what I can get. I just need a poll that will be attached to each post and work inline. IE: Not something I have to slap on a sidebar. Something that I can add to the index.php file with my loop, and also the single.php file would be excellent. However this might get tricky as the poll results would have to be dynamic to each post. I would also be okay with having to add a shortcode to each post (as there are plug-ins which can add shortcodes to posts by default without anyone being able to see them) but that seems sort of hack and slash to me. Thanks for any help on this. Hope I was clear enough.


How can I hide the category term for posts with none set?

I'm trying to hide the word "Category:" from the metadata on the Twenty-Eleven theme's footer, when I don't have one set for a given post (sometimes I will manually remove the "Uncategorized" category, and sometimes I will be using Custom Post Types with Categories I have yet to create). I know how I can do it with my custom post types' versions of "categories" and "tags:"               <?php if (get_the_term_list( $post->ID, 'length' ) != null ) { ?>
Length: <?php echo get_the_term_list( $post->ID, 'length', '', ', ', '' ); ?>
             <?php } ?>          From my understanding, the above conditional says, "If you get the term list and it's got the taxonomy "length," and it's NOT empty, then go ahead and show the list for that term." But for the existing Categories and Tags, how would I do it? I thought about using `has_terms` like so:               if( has_term( 'category' ) != null ) {     //do something     }      But I don't know what the 'something' is! I don't want it to display the categories if there are none (that what it's doing anyway), so should I be adjusting what's already there:               $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );      somehow? Thanks for any clarity you can provide!


Cron Job variable not accessible

I am currently running a cron job on my cPanel to update a variable containing exchange rates, how can I make this variable available to functions and pages in my wordpress site? **My command in cPanel for cron job running every minute:**               php -q /home/username/public_html/cronjob.php      **cronjob.php**               <?php     require('wp-blog-header.php');     $exchangeRates = getExchangeRates();          function getExchangeRates(){     // etc etc     }


How to check a post is sticky or not yet?

I want to check a post a post is sticky or not to do some function. Thanks all for help ;)


Multiple Page Templates & CSS

What's the best practice for handling CSS on a theme with multiple page templates? For example: I will have a Full Width page template and a 2-column page template. Is it best to just call out the containers in a single CSS (#fullWidthContainer vs. #twoColumnContainer) Or is it better to have separate CSS files for each page template?


Problem with Front-Page.php loading recent posts

Hi I this weird problem where i have my custom front-page.php with set page (in Reading Settings) static page. What I want to have is a static page with welcoming message and later 1 recent posts from post-type and 4 recent posts form custom post type. To get static page info I use:               <?php while ( have_posts() ) : the_post(); ?>       <?php get_template_part( 'content', 'page' ); ?>     <?php endwhile; // end of the loop. ?>      Then to get 1 recent posts I use:               <?php         $args = array( 'numberposts' => '1', 'meta_key'=>'_thumbnail_id' );        $recent_posts = wp_get_recent_posts( $args );        foreach($recent_posts as $post) : ?>           <?php get_template_part( 'content', '' ); ?>     <?php endforeach; ?>      And finally, to load 4 custom posts:               <?php         $getPorftolio = new WP_Query( 'post_type=portfolio&posts_per_page=4' );        if ($getPorftolio->have_posts()) {           while ($getPorftolio->have_posts()) {             $getPorftolio->the_post();                  get_template_part( 'content', 'portfolio-index' );           }     } ?>      Of course there are additional mark-up and content- ___ pages work just fine (separately work well). Problem is when it loads, the POST type post (where loads only 1) the info is mixed up. It loads correct title, correct featured image, but categories, tags, meta is empty and excerpt is from static page. As if it mixes where it should load static page info and post info. The biggest mistery - the same page works completely fine on my local WAMP. The test server: http://www.appuilab.com/sandbox/nerijusgood/ **EDIT** : I also added , which did not help at all. Also I have noticed that my tags/categories/post-meta is messed up on my blog (home.php) as well. So I figure maybe the problem is in the template part content.php (in both places this one is loaded). Meta is loaded with the same function in each page (in others it works just fine). Any ideas? I am _still_ bummed ;/


How to publish a Page and Posts using single template

Does anyone know how to structure a WP template in the loop by: Publishing the page content on top, immediate followed by certain category posts underneath the page content? Seems like it should be straight forward. I have not been able to locate any help on it. Thank you. **Here's what I pulled together so far:**               <?php     /**      * Template Name: Page & Posts      */     ?>     <?php get_header(); ?>

                 <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>                     <div id="post-<?php the_ID(); ?>" <?php post_class('g post'); ?>>
                             <?php if ($options['mts_breadcrumb'] == '1') { ?>
<?php the_breadcrumb(); ?>
                             <?php } ?>
<?php the_title(); ?>

                                 <?php the_content(); ?>

                     <?php comments_template( '', true ); ?>                 <?php endwhile; ?>                     <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<a href="<?php comments_link(); ?>"> <?php comments_number('0','1','%'); ?>

                                     <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?>
                                 <?php if($options['mts_headline_meta'] == '1') { ?>
                                          <?php _e('Written on ',''); the_time('F j, Y'); ?>                                         <?php _e('by ',''); the_author_posts_link(); ?>                                         <?php _e(' in ',''); the_category(', ') ?>
                                 <?php } ?>                                                          <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="nofollow" id="featured-thumbnail">                                 <?php if ( has_post_thumbnail() ) { ?>                                      <?php echo '
'; the_post_thumbnail('featured',array('title' => '')); echo '
'; ?>                                 <?php } ?>
                                 <?php echo excerpt(53);?>

<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="bookmark"><?php _e('Read More',''); ?>

                     <?php endwhile; endif; ?>                        <?php if ($options['mts_pagenavigation'] == '1') { ?>                         <?php pagination($additional_loop->max_num_pages); ?>                     <?php } else { ?>

<?php next_posts_link( __( '← '.'Older posts', '' ) ); ?>

<?php previous_posts_link( __( 'Newer posts'.' →', '' ) ); ?>

                     <?php } ?>

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


Extend walker class with custom post types

I'm using the walker class below, but I can't make it work with custom posts.                class Zwp_Walker_Nav_Menu_Dynamic extends Walker_Nav_Menu {         function end_el(&$output, $item, $depth) {             global $wp_query;             global $post;             $thePostID = $post->ID;                  $subposts = get_posts( 'numberposts=10&cat=' . $item->object_id );                  if ( $subposts ) {                      $output .= '
object_id == $post->ID && 100 == 101) { $output .= ' sub-menu-current'; } else { $output .= ' sub-menu'; }                 $output .=  ' sub-menu-item-'.$item->object_id.'">                 ';                 foreach( $subposts as $post ) :                     setup_postdata( $post );                     $output .= '
post->ID == $post->ID ) {                          $output .= ' class="current"';                      }                     $output .= '>ID ) .'">' . get_the_title( $post->ID ) . '
                     ';                 endforeach;                 $output .= '
                 ';                  }              }     }         I tried to change the get_posts query, but I get strange results. (Probably because the ID is missing)               $subposts = get_posts( 'numberposts=10&post_type=portfolio_work' );      The result:               Design »         Project 1         Project 2     Photography »         Project 1         Project 2     About »         Project 1         Project 2      This is how it should look like:               Design »         Project 1     Photography »         Project 2     About


Display Admin Bar on "Non-WordPress" PHP Page

On my WordPress multisite, I am generating a page directly from a .php file (http://example.com/sort.php) and would like to display the admin bar across the top of the page. While I am able to display the site's main navigation menu, I've been unable to call the admin bar successfully despite many attempts. The .php file - which is located in the root directory - starts with the following:               require_once( './wp-blog-header.php' );          get_header();      Then follows a div and the php code that creates the page. In this file, I am calling the footer using `get_footer()` as I've read that displaying the admin bar requires both the header and footer to be called. Any guidance about how to proceed would be most appreciated!


update_options and unique filenames

I was able to temporarily disable an automatic task of wordpress during a specific file type upload which is nice. For instance, I changed the usual upload path for the pdf uploads by doing this:               //change the normal path     update_option('upload_path','wp-content/uploads/attachments/'.$id);     //upload the file     $upload = wp_upload_bits($pdffile,null,file_get_contents($pdffile_temp));     //get the standard path back     update_option('upload_path','');      Now I would like to do the same with the "wp unique filename" function that is automatically called by wordpress. The same way I changed temporarily the path for this specific upload routine, I would like not to rename the file if another one has the same name inside the target folder (I would rather overwrite the old file with the new one instead). How could I do that? Thank you.


Error with Custom Admin Screen in iframe Thickbox

I have a plugin that adds a new admin screen in an iframe. I created a PHP file in my plugin, and I put a link with a class of Thickbox to that. Everything works just fine, but it produces a PHP error when WP_DEBUG is set to true. Looking at the WordPress source code, there's no way around the error if I put a PHP from outside /wp-admin/ directly in an iframe. > Notice: Undefined offset: 1 in .../wp-includes/vars.php on line 28 It happens because WordPress is running regex on the web address to extract the file name to set the $pagenow variable, but it assumes the file will be in /wp-admin/. Since it's not, there are no matches. Here is the plugin. The file is children.php. Is there a better way to create a custom admin screen that can be included in an iframe Thickbox that runs through a /wp-admin/ file?


Force WP to ignore multiple whitespaces

Is it possible to force WP to ignore multiple whitespaces so in the frontend so there’s only one visible? It’s because when my client writes something in the editor sometimes he enters two spaces instead of one and doesn’t notice that. I was quite confused about the fact that multiple whitespaces aren’t ignored automatically because in the source code there is a double whitespace `" "` which to my mind is ignored by all browsers, not `"  "` or `  `.


Which Details Are Required For Style.css File Header?

Which theme details are absolutely required for your style.css file header? I'm developing my first theme for personal use, so do I really have to include things like a license, license uri, author, author uri, etc. WordPress Docs just give an example, but they don't reference what's required. Does anyone know?               /*     Theme Name: Twenty Thirteen     Theme URI: http://wordpress.org/themes/twentythirteen     Author: the WordPress team     Author URI: http://wordpress.org/     Description: The 2013 theme for WordPress takes us back to the blog, featuring a full range of post formats, each displayed beautifully in their own unique way. Design details abound, starting with a vibrant color scheme and matching header images, beautiful typography and icons, and a flexible layout that looks great on any device, big or small.     Version: 1.0     License: GNU General Public License v2 or later     License URI: http://www.gnu.org/licenses/gpl-2.0.html     Tags: black, brown, orange, tan, white, yellow, light, one-column, two-columns, right-sidebar, flexible-width, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, translation-ready     Text Domain: twentythirteen          This theme, like WordPress, is licensed under the GPL.     Use it to make something cool, have fun, and share what you've learned with others.     */


Prevent from deleting any user role but subscriber

In the administration of my blog, I would like to prevent anyone (admin included) from deleting any user unless it is a simple subscriber. Basicaly, in the "users" section of the administration, I would like the option "delete" to only be visible under the subscribers, not under the administrators, editors, authors or contributors. How can I do that in my functions.php file (I'm not interested in a plugin)? I tried the "remove_cap ('delete_users')" function but it has a too large scope as it prevents from deleting any user while I would like to prevent deleting any user BUT the subscribers. Thank you for your help.


bloginfo() vs get_option?

What's the difference between: `bloginfo('name');` vs `get_option('blogname');` The parameter is just an example, but I see no differences in terms displaying what I want. Are there any particular differences? Or are they just for semantic reasons. Thanks in advance.


Dealing with a looping input form

I'm learning php, don't yet have javascript/jquery skills. If I have 10 posts with 8 marked as status="Approved" and 2 marked as status="Draft", I'm trying to use radio buttons to change "Draft" status to "Approved" for selected items. My code is displaying both "Draft" posts each with a radio button/submit button, and when I submit I get one action that applies to both posts. How do I get the code to process each iteration independently, or is there a more elegant approach?

                 <?php while ( $wp_query->have_posts() ) : $wp_query->the_post();                    $metastatus = get_field("rdc_appstatus");                 $metafile   = get_field("rdc_filename");                 $posttitle  = get_the_title(); ?>                 <?php if ( $metastatus == "Draft")  :                  $draftcount++;  ?>

 <?php echo $posttitle; ?>

<?php echo $metastatus; ?>

                             <?php echo "";?>

                              <form action="#" method="post">

<input type="radio" name="status" value="draft" checked="checked"/>Draft

<input type="radio" name="status" value="approved" />Approved

<input type="submit" name="submit" value="Update"                                     />

                              </form>
                          <?php $status = ($_POST['status']); echo 'Status:'.$status; ?>

                       <?php                  endif;                  endwhile;                  if ($draftcount == 0) : echo '
No Draft Items Found
';                  else :                 echo '
 '.$draftcount.' Draft Items Found
';             endif;             ?>


Getting parent category hierarchy as objects from category template

What is the best way to get the hierarchy of parent **category objects** from the `category.php` template, when there is no post as such. The function `get_category_parents()` returns a string not the objects. The function `get_categories()` seems to be intended for pages where there is a post because the `type` argument can take either `post` or `link`. Is there any other function I am missing? I would need something that behaves exactly like `get_category_parents()` but I need the category objects not just a string of all of the names.


Remove Items from Template Homepage

I've never used Wordpress but am considering it for a responsive church website. BEFORE I purchase space froom a webhost here's my question preceded by a scenario I want: Scenario: I want my landing page to be very simple. A header, horizontal links below the header, a horizontal slide show beneath the links and then a very simple statement about the church then a footer. That's it. I want the visitor to see everything without scrolling down that particular page (inside pages don't matter). Question: If I use a responsive Wordpress template, can I delete the items from the landing page I don't want on it? Thanks


show User Registration Date in Wordpress

i want to show user registration date like **Member since** : 15,dec 2012. I have a code `<?php echo date("M Y", strtotime(get_userdata(get_current_user_id( ))->user_registered)); ?>` but it show same date in all users profiles. Can some one please tell me how i fix that.


Get the latest comment from a custom post type where depth = 1?

Happy new year everyone. I've been struggling with this one for a while. I need to get the latest comment from a custom post type, but ignore any child comments i.e. only look at comments with a depth of 1. I can get the latest comment from a custom post type using:               $args = array(         'post_type' => 'custom-post-type',         'number' => '1',         'orderby' => 'date',         'order' => 'DESC'       );          $comments = get_comments($args);     foreach($comments as $comment) :         echo($comment->comment_author . '<br />' . $comment->comment_content);     endforeach;      However, it doesn't take into account the depth requirement. Any ideas how I can achieve this?


Fix incorrect related posts code snippet

Can anybody fix this incorrect related posts codes snippet?               function related_posts() {     if (is_single()) {         global $post;         $current_post = $post->ID;         $categories = get_the_category();     foreach ($categories as $category) :         ?>

Related Posts

         <?php         $posts = get_posts('numberposts=5&category='. $category->term_id . '&exclude=' . $current_post);     foreach($posts as $post) :         ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
         <?php endforeach; ?><?php endforeach; ?>

         <?php             }         wp_reset_query();     }     add_action( 'genesis_after_post_content', 'related_posts' );      This snippet works fine to display related posts specifically for parent category. Problem is happening after publishing a post under child category (like under “Social Media -> **Facebook** ”. # Related posts being displayed twice one for parent and other for child category. Which i don't want. ![enter image description here](http://i.stack.imgur.com/F7tuS.png) Related posts should specifically show based on that particular category, that under the post is published no matter whether it's parent or child category. Can anybody help me regarding this ? Any help would be appreciated :)


Multiple images in one attachment page

I want multiple images for one post attachment page, but there is no option for that. How can I do that? ![enter image description here](http://i.stack.imgur.com/9EZfml.jpg)


Restrict Author to pick from media library, but not upload media

I have a multisite network where the super admins will be creating the individual sites. An important role we need to enable, for compliance reasons, is to restrict "Authors" to not be able to upload media, but be able to access the media library to choose from media that is uploaded by the super admin. I have downloaded the User Role Editor plugin, which is a great plugin btw, but the only option it gives is to turn off the "upload_files" function. That takes away all ability to access the media library. No bueno. Anyone wanna take a stab at this??


How can I show recent posts from same taxonomy as the post currently being viewed?

I'm wondering how I can show recent posts from the same taxonomy as the post that's currently being viewed (working with custom post types and custom taxonomies). If it was simply a category of a regular post, it would look like this:               <?php global $post;     $categories = get_the_category();     foreach ($categories as $category) :     ?>
More News From This Category

     <?php     $posts = get_posts('numberposts=20&category='. $category->term_id);     foreach($posts as $post) :     ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
     <?php endforeach; ?>
<a href="<?php echo get_category_link($category->term_id);?>" title="View all posts filed under <?php echo $category->name; ?>">ARCHIVE FOR '<?php echo $category->name; ?>' CATEGORY »
     <?php endforeach; ?>
      But with custom posts/taxonomies, there has to be a different sort of solution. Couldn't find anything useful so far in the wordpress codex.


Add Rewrite Rule for custom page

Was trying to create author specific page with author specific URL and it was working fine,but when i created this URL did not taken in to account following 2 factors   1. Author Name Conflict (similar name).   2. Paging option to be added to author page (for his published posts) here is my initial rule               function add_my_rule() {             global $wp;          $wp->add_query_var('args');            add_rewrite_rule('writer\/(.*)','index.php?pagename=writer&args=$matches[1]','top');          /*global $wp_rewrite;         $wp_rewrite->flush_rules();*/     }     add_action('init', 'add_my_rule');       This was working file for a URL say               www.myblog.com/writer/umesh-awasthi ,      but there can be more author with same name and this will create a issue.So i was planning to have Blog author URL like SO have `www.myblog.com/writer/001/umesh-awasthi` where `001` is user id which will always be unique. second issue is with paging, as i am able to create paging on the author page but when user is clicking second page the URL is coming as `http://localhost/blog/wordpress/writer/umesh-awasthi/page/2/` so as per my URL-Rewrite rule i will get following data as parameter `umesh-awasthi/page/2` which means that now my query will not work as it will expect the author name as `umesh-awasthi` and will get it as `umesh-awasthi/page/2` My Question is can i rewrite the rule so that i should get data in following way in three different variables   1. userid   2. author name   3. page number (if it exits) being new to the WP and rewrite i am not sure how i can achieve this thanks in advance


Need Comment Link Help

I am interested in adding a comment form at the end of my posts from the home page. I use Disqus and the comment form shows up when you click onto the actual post itself but not after a post on the home page. At the very least, moving the comment link from the title area to the end of each post (on the home page) would be great, as it's currently hard for people to find where to comment. I'm using the free platform theme by pagelines. My url is www.trinketsofthought.com. I'm not the most techinal/code-y type of person, so help in the form of dummed down terms would be fabulous. I greatly appreciate your time!


Disable dashboard drag&drop

I need to disable drag&drop functionality for dashboard widgets. This should be realized with jquery, just as it is for the dashboard_browser_nag. I'm no jquery expert - so can anybody tell me how to find and modify my widgets with jquery? So far, I know that I have to do some .sortable("cancel"), but how exactly? Thanks!


Building theme so user can change header image

My Google-Fu is letting me down so I'm trying it here. I'm building a theme and I want the customer to be able to change the header image him/herself in the wp-admin. How do I go about this? As I said my Google-Fu has been embarrasingly lacking on this one so even a link to where to start would be fantastic. Thanks!


WordPress admin screen very slow / timing out when editing or adding a new page/custom post

I'm new to the site but appreciate any help you can give. I have a WordPress set-up which (rightly or wrongly) has hundreds of pages and thousands of another custom post type which is also based on a page (ie hierarchical). When attempting to add a new page or custom post type (or edit an existing one) in the admin, the edit page screen loads extremely slowly if at all. Usually timing out around the Attributes Box mark (sometimes it will load the entire page, sometimes not, but basically it's either extremely unusable or not usable at all). My assumption is that because there is so many items to be loaded on the hierarchy menu (within the Attributes Box) it's causing the time out. I understand that perhaps using so many pages in this way is perhaps not optimal for WP, but this is the situation the site is in now and I cannot easily change it (and unfortunately the ability to put a page within a certain hierarchy is needed so I can't just hide the Attributes box from the admin). In the long run maybe the site needs to be rebuilt to use only posts however is there anything I can do for now to either help WordPress load the edit page fully and/or speed it up. Any htaccess/php.ini hacks (I've tried a couple, like increasing memory size/execution time but didn't seem to help) or anything else you think I can try (I am open to nearly any idea), something in MYSQL to cache it maybe (I'm not an expert on this unfortunately) Really appreciate any help you can give Thanks, Nick PS It's WordPress 3.2.1 PPS I also tried editing the permalink structure so it doesn't include %post-name but that didn't help PPPS I also tried duplicating the site and upgrading to WordPress 3.3 latest beta but still the same PPPPS The site is on a Rackspace Sites Cloud Server Also... I tried disabling the Attributes box and just trying to use the Quick Edit function on the Pages listing part of the admin to control hierarchy but this is not responsive presumably because it is 'timing out' because of the same issue, so unfortunately my temporary workaround idea doesn't really do it either, cheers.


Wordpress create new <section> on site when a new page is added

I'm trying to create a single page wordpress theme. Whenever I add a new page, I want a new to be added to my Single page theme. I'm currently using this code:               $pages = get_pages( array ( 'sort_order' => 'asc', 'sort_column' => 'menu_order', 'depth' => 1));                  foreach ( $pages as $page ) {               $page_section = str_replace( " ", "", strtolower( $page->post_name ) );                  echo '

';             }             ?>      What I want is for it to create a new with an ID and Dataslug that match the page name (which is also the label on the link in the Menu). For example, say I insert a page called about, The menu item will read "about" and this code will be added to the page


Adding Menu & Sub Menu In Wordpress Not Working

i have added the below function in my **_functions.php_** in theme folder.. and i refreshed my **_wp-admin_** page.. but the sub-menu is not coming               add_action('admin_menu', 'register_custom_menu_page');          function register_custom_menu_page()     {        add_menu_page('View Orders', 'View Orders', '', 'orders/vieworder.php', '', plugins_url('orders/small_cart_icon_20.gif'), 100);        add_submenu_page( 'orders/vieworder.php', 'My Custom Submenu Page', 'My Custom Submenu Page', 'manage_options', 'orders/vieworder.php' );      }


wp_login_form redirect

Is there a way to redirect a user who logs in using wp_login_form to a custom page that is created automatically on signup It seems like the URL needs to be absolute and obviously the end of the URL would change with each user. Please see the function used to create the page on signup               function create_user_page($user_id) {         if ( $user = get_userdata($user_id) ) {             // Create a new user-specific page             $page = array(                     'comment_status' => 'closed',                     'ping_status' => 'closed',                     'post_name' => $user->user_login,                     'post_status' => 'publish',                     'post_title' => $user->user_login,                     'post_type' => 'page'                 );      So, when a user logs in via the page that includes wp_login_form they need to be redirected to http://www.websiteurl.com/user1 etc. where user1 is the page that has been created. I hope that made sense.


How to get a value from PHP in Jquery through Ajax

**I'm trying to get a value from a PHP function through Ajax and save it in a variable in jquery.** The PHP;               add_action( 'wp_ajax_mark_as_read', array( &$this, 'readen_color' ) );          public function readen_color() {        if( isset( $_POST['post_id'] ) && is_numeric( $_POST['post_id'] ) ) {           echo 'hello';        }     }      The Jquery:               $(document).ready(function(){     alert ('Test');     var sArticleId, iPostId;          // Get the article ID and split it -      sArticleId = $("article").attr('id');     iPostId = parseInt(sArticleId.split('-')[1]);          $.post(ajaxurl, {      action:'readen_color',      post_id: iPostId     }, function (response) {     console.log(response);          var response = parseInt(response);     alert('value of response: ' + response);                 });     });      Any ideas what i'm doing wrong? Could not answer the my own question but Now it works with:               var responsevar = response;     alert('The Server Responses: ' + responsevar);      Instead of:               var response = parseInt(response);     alert('value of response: ' + response);


Permalink Settings

I have a `.htaccess` problem what buggs me out for couple of hours already. I have updated the file as it should be:               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /zootaxi.lv/     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /zootaxi.lv/index.php [L]     </IfModule>     # END WordPress      and Im working on localhost. I've tried both paths:               C:\wamp\www\zootaxi.lv      and               C:\wamp\www\zootaxi.lv\wp-content\themes\zootaxi      Advice much appreciated, Thanks


how to extract the username of the wordpress user?

I am designing a code that uses that involves a pluggin. I need to extract the current wordpress users username to fetch him special authorities. This extraction of the username is being done in a php file of the pluggin.


Set WordPress Default Template

I'm using the _Options Framework Theme_ to put together my options page and would just like to know how would I set up/call the _Default Template_ \- for whichever one the user has selected. For example, on my _Theme Options_ page, you can choose from the following:   1. Full Page   2. Side Bar Left   3. Side Bar Right Which looks something like this: ![enter image description here](http://i.stack.imgur.com/mjQSI.png) Once the user has selected one of these options, when they go to create a _New Page_ , in the _Page Attributes > Template_ drop-down menu, the " _Default Template_ " should be the one that they chose from before... ![enter image description here](http://i.stack.imgur.com/MCyXo.png) In my `options.php` file:               $options[] = array(             'name' => "Default Template",             'desc' => "The default layout when a new page is created.",             'id' => "layout_options",             'std' => "2c-r-fixed",             'type' => "images",             'options' => array(                 '1col-fixed' => $imagepath . '1col.png',                 '2c-l-fixed' => $imagepath . '2cl.png',                 '2c-r-fixed' => $imagepath . '2cr.png')         );      To call the output:               <?php echo of_get_option('layout_options', 'no entry' ); ?>      Where/what would I need to paste in throughout my theme files to grab the users selection and point it towards the _Default Template_ , as currently it may only be saving the selected image?


How to add_filter/action to comment out CSS generated by admin function?

So in wp-includes/admin-bar.php there is a function that adds CSS styling to the page:                   function _admin_bar_bump_cb() { ?>         <style type="text/css" media="screen">             html { margin-top: 28px !important; }             * html body { margin-top: 28px !important; }         </style>         <?php         }      I want to comment this out properly (either the function or the contents of the function, either one is fine) but not touch the core code. How would I do this?


how to use a single checkbox with wpalchemy?

I can find some little example on using multiple checkboxes, but no one about using a single checkbox in a wpalchemy metabox. Anyone can help me please? No docs about this topic on the wpalchemy site.. Thank you


how can i display taxonomy instead of category on my web page?

I want to display taxonomies instead of categories on the homepage of my blog. What can I do to achieve this?


Allow admin login at /admin

I am interested in:   1. how can we change the default login url `/wp-admin` to `/login`   2. how can we add another url for login so that both `/wp-admin` and `/login` would work I tried to use a custom filter and .htaccess as in the following example but without success. functions.php               add_filter('admin_url', 'my_new_admin_url');          function my_new_admin_url()     {         return '/login/';     }      .htaccess               Redirect permanent /wp-admin/ /login/


Show 10 newest post for each value of a custom taxonomy

I am working on a theme that has a custom post type called `Languages` and it will have a custom taxonomy called `Language` which will act as a category. Now let's assume my `Language` taxonomy has these 4 values for now, `English`, `French`, `German`, `Spanish`. I would like to have something like this with this custom taxonomy/category on my sidebar... **English**   \- link to newest post   \- link to 2nd newest post   \- link to 3rd newest post   \- link to 4th newest post   \- All the way to the 10th post   **\- then a link to View all** **French**   \- link to newest post   \- link to 2nd newest post   \- link to 3rd newest post   \- link to 4th newest post \- All the way to the 10th post   **\- then a link to View all** **German**   \- link to newest post   \- link to 2nd newest post   \- link to 3rd newest post   \- link to 4th newest post \- All the way to the 10th post   **\- then a link to View all** **Spanish**   \- link to newest post   \- link to 2nd newest post   \- link to 3rd newest post   \- link to 4th newest post \- All the way to the 10th post   **\- then a link to View all** So as you can see, I just need to list all of a certain taxonomy, then under each one show the 10 newest post under that category ande provide a link to the view all page Please help me do this someone I know how to set up the taxonomy and custom post type, I just need help getting it to show each one and the 10 newest post for each one in a list like that


Extremely slow Wordpress website with 6000 posts

I have a website with 6000 posts and it is extremely slow. Sometimes I get this error in my browser:               Service Temporarily Unavailable          The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.          Error: 503 Service Temporarily Unavailable      I have turned almost all plugins off and it is slow in frontend and in backend too, so I guess it is not because of the template. Could it be because of WP_navigation plugin? I have est. 600 pages with ten posts or WP navigation plugin, could this be the problem?


How can I override one post and make it display content for another post?

I have two pages on my Wordpress site:               mysite.com/?p=100     mysite.com/?p=200      I think I should be able to hook into Wordpress' actions somewhere and re- query the post, so that content for `mysite.com/?p=200` would be displayed on the page `mysite.com/?p=100` Based on feedback from the first answer, I think it would need to look something like this:               add_action( 'pre_get_posts', 'wpse35832_pre_get_posts' );             function wpse35832_pre_get_posts( $query ){              $pid = '';              if( ! empty( $query->query_vars['page_id'] ) )         {             $pid = $query->query_vars['page_id'];         }         elseif( ! empty( $query->queried_object->ID ))         {             $pid = $query->queried_object->ID;         }              if($pid == '100'){             $query->query_vars['page_id'] = 200;         }              return $query;          }      And actually that function does work - but with one caveat: If I use pretty permalinks (`mysite.com/name-of-page/`), the title of the page is for the original post. However if permalinks are in the query variable style, everything seems to work fine. **What am I doing wrong, and how can I fix it?** I tried `unset($query->queried_object` so that it would need to be re-queried, and doing that causes a redirect back to the original page. Basically I'd like the whole webpage that is rendered to be exactly the same as it would be for the other post, including title tag, post title, and post content, and so I'm trying to hook in early enough to make that happen. I realize I could create a custom page template, something like `post-200.php` and inside that use the `query_posts` function and display content. This is not what I'm trying to do though. I admit this would serve no practical purpose on most blogs, but I think it is possible and I hope you guys can give me some help with doing it.


the_post_thumbnail hard cropping not working no matter what

No matter what I do - I can't get the hard cropping mode in the_post_thumbnail to work. Here's what I have:               add_image_size( 'Blog', 300, 300, true );      the_post_thumbnail('Blog');      I've also tried:               set_post_thumbnail_size( 300, 300, true );     the_post_thumbnail();      I've tried uploading new images, and using the "Regenerate Thumbnails" plugin, but still no luck. It completely ignores the "true", and acts as if it's "false". For example, instead of the image being 300x300, it'll be 300x238 or something. Has anyone else experienced this? My GD Library is enabled.. Thanks for any input anyone can offer =)


extract shortcodes from string

i need a little help to with this issue: I have a string wich contains shortcodes like `[shortcode data="1" data2="2"]` How I can extract with regex? without wordpress system? Thanks in advance.


redirect does not work in ajax function

I'm using ajax to post the form data. In the end I want to redirect to homepage. I'm trying following code, it does not work. It returns error 302. How can I redirect in the following function? Thanks.               add_action('wp_ajax_nopriv_custom_register', 'custom_register');     add_action('wp_ajax_custom_register', 'custom_register');          function custom_register(){              //process              wp_redirect( home_url() );         exit;     }


Help me add Taxonomy to byline

The following is my code for adding a byline to a post. Can you please explain how I can get my taxonomy onto this. The taxonomy is destination.               /*********************     CLEAN BYLINE     *********************/     if ( ! function_exists( 'cb_byline' ) ) {           function cb_byline($cb_cat = true, $cb_post_id = NULL, $cb_short_comment_line = false, $cb_posts_on = false) {              $cb_meta_onoff = ot_get_option('cb_meta_onoff', 'on');          $cb_disqus_code = ot_get_option('cb_disqus_shortname', NULL);         $cb_byline = $cb_cat_output = $cb_comments = NULL;         $cb_cats = get_the_category($cb_post_id);              if ( isset( $cb_cats ) && ( $cb_cat == true ) ) {             $cb_cat_output = '
 ';             $i = 1;             foreach($cb_cats as $category) {                 if ( $i != 1 ) { $cb_cat_output .= ', '; }                  $cb_cat_output .= ' term_id ).'" title="' . esc_attr( sprintf( __( "View all posts in %s", "cubell" ), $category->name ) ) . '">'.$category->cat_name.'';                  $i++;             }             $cb_cat_output .= '
';         }         if ( $cb_disqus_code == NULL ) {              if ( get_comments_number( $cb_post_id ) > 0) {                 if ( $cb_short_comment_line == true ) {                     $cb_comments = '
' . get_comments_number( $cb_post_id ) . '
';                 } else {                          if ( get_comments_number( $cb_post_id ) == 1) {                              $cb_comment_line = __('Comment', 'cubell');                      } else {                             $cb_comment_line =  __('Comments', 'cubell');                     }                     $cb_comments = '
'. get_comments_number( $cb_post_id ) . ' '. $cb_comment_line .'
';                      }             }         } else {                  $cb_comments = '

';              }              $cb_date = '
 <time class="updated" datetime="'. get_the_time('Y-m-d', $cb_post_id).'">'. date_i18n( get_option('date_format'), strtotime(get_the_time("Y-m-d", $cb_post_id )) ) .'</time>
';              if ( ( $cb_meta_onoff == 'on' ) || ( $cb_posts_on == true ) ) {             $cb_byline = '
' . $cb_author . $cb_date . $cb_cat_output . $cb_comments . '
';         }              return $cb_byline;               }     }


Edit a different page in WP Customizer

I'm working with Customizer's incredible options, and so far so good, it's really powerful and does everything I want. However, I'd like to extend it, so instead of editing only the main page, I want to allow editing of inner pages. While I achieved this (saving the changes and navigating to the edited page), I can't make it work in live Customizer. I mean, even if I navigate to that page inside Customizer, it isn't grabbing the live changes at all. I've added the JS bind for live preview so that isn't the problem (plus, it works if I save, it just doesn't show in LIVE mode). Is there a way to achieve this, or is it just that live Customizer works only for the main page? Another related question: I have these inner page sections apart of the main page section. Is it possible to make the preview window load the page I want to edit when I click the accordion tab for that section? I'm thinking that maybe that's the issue. Just to be clear: site title, background, header, etc ----> main page in preview window   portfolio items ----> load portfolio page in preview window   store items ----> load store page in preview window Any help appreciated, I was searching on Google and here, but couldn't find anything so far.


'Archive' folder for posts and pages

Of course there is a Drafts section in Post and Pages, but how would I make an Archive section - which would contain previously published posts and page?


feedburner email notification when post is updated

I usually need to update my posts when there have new information. As default feedburner don't send email notification when the post is update but I check another site (using custom template), he create an update page and each time he post on it, reader will get feedburner email notiication, but it's not new post. It's old post (the post that just has been updating) and the information that just has been updated. News page: http://www.ptc-investigation.com/news.aspx Homepage: http://www.ptc-investigation.com/default.aspx \- "News & Updates" section. Can I create something like that in wordpress? Thank you.


Metadata for a taxonomy - is there any WordPress way of doing this?

If I have a CPT "movies" I know I can have various taxonomies eg "Director", but how can I store further information such as "director's nationality" for any one particular director ... or is this possible using WordPress?


Filter image and text from post format

I have a site that requires a lot of styling for post formats, I have never dealt with formats before but essentially what I want is : if post format is image... do this loop, if format is standard show The problem is that I am using a filter in the loop on single.php to pick out the image posted and show it as a header. This seems to be getting in the way of the showing standard content mark up if the format is 'standard' function Here is the single.php                               <article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article" itemscope itemtype="http://schema.org/BlogPosting">
                                       <?php                             preg_match_all("/(]*>)/",get_the_content(),$matches,PREG_PATTERN_ORDER);                             for( $i=0; isset($matches[1]) && $i < count($matches[1]); $i++ ) {                             echo $beforeEachImage . $matches[1][$i] . $afterEachImage;}?>

                             <?php                                ob_start();                                the_content('Read the full post',true);                                $postOutput = preg_replace('/]+./','', ob_get_contents());                                ob_end_clean();                                echo $postOutput;                             ?>

<?php get_sidebar(); // sidebar 1 ?>

                                                                                <?php else : ?>                            <?php the_content(); ?>                          <?php endif; ?>


Display future single post 404 error

I have a custom post type `kalender`, a template which displays all of the posts in this custom post type and a `single-kalender.php`. Everything works fine when the user is logged in but when logged out the single pages return a `404 error`. I'm assuming I get the `404` because I'm trying to display future posts when not logged in. How would I go ahead and solve this issue? **EDIT 1**               $labels = array(       'name' => __('Events'),       'singular_name' => __('Event'),       'add_new' => __('Nieuw event'),       'add_new_item' => __('Nieuw event'),       'edit_item' => __('Event bewerken'),       'new_item' => __('Nieuw event'),       'view_item' => __('Bekijk event'),       'search_items' => __('Doorzoek Events'),       'not_found' =>  __('Niets gevonden'),       'not_found_in_trash' => __('Niets gevonden in de prullenbak'),       'parent_item_colon' => ''     );          $args = array(       'labels' => $labels,       'public' => true,       'query_var' => true,       'menu_icon' => get_stylesheet_directory_uri() . '/img/events.png',       'hierarchical' => false,       'menu_position' => null,       'rewrite' => array( 'with_front' => false ),       'supports' => array('title','editor','thumbnail')       );           register_post_type( 'kalender' , $args );     flush_rewrite_rules();      **EDIT 2** I've added some code in the `404.php` template which would detect if the page which is trying to load is in the custom post type `kalender`. This works:               <?php          global $wp_query;              if ('kalender' == $wp_query->query_vars["post_type"]) {             include 'single-kalender.php';         }         else{ ?>             </div><!-- .menu-container -->             <h1>Error 404</h1     <?php } ?>      Now I'm trying to query that specific single custom post type in the `single- kalender.php` template but I can't get it to work. The following query outputs no posts, even though the `found_posts` variable is 1 (works as expected) but the `posts` array remains empty unfortunately.               global $wp_query;     $name = $wp_query->query_vars["name"];          add_filter( 'posts_where', 'my_posts_where_from_today' );          $query = new WP_Query(array('post_status' => array( 'publish', 'future' ), 'post_type' => 'kalender', 'order' => 'ASC', 'name' => $name ));      When I use the generated query on my database it selects the single custom post type as expected, the generated query is the following:               SELECT   wp_posts.* FROM wp_posts  WHERE 1=1  AND wp_posts.post_name = 'slug-of-the-post' AND wp_posts.post_type = 'kalender' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'future') AND post_date > '2013-04-11'  ORDER BY wp_posts.post_date ASC       If you want to check the whole `print_r($query)` see here: **http://pastebin.com/cSzmXDVb**


Login from third-party application with WordPress credentials

I've made a web app with WordPress and it works great. Recently I started developing for Android. So far I've made an app with some webviews to load the correct web apps URL:S, and a menu. But now I've started thinking about doing a native android login activity instead of just using the standard WordPress login page. So my question is: Does WordPress support this kind of user authentication? If not, would it be possible if I changed the WordPress login to something like Google+ Sign in, Oauth or OpenID+ I don't have any experience with this things, so I don't really understand the texts that I've been reading about this.


Mail sending randomly fails

I'm having a troublesome problem here. I set up a event subscription plugin that should send a confirmation mail at the end of the subcription process. Here's the code:               wp_mail( $data['email'], $settings->field('confirmation_mail_subject'), $mail_body, array("Content-type: text/html"));      I get recognize a pattern for this problem. Any idea?


How can I manage my multiple wordpress websites from main website?

Can this solution be used for multiple WP installations on the same site? For example, I have multiple blogs (multiple subdirectories), i.e. mysite.com/blog1, mysite.com/blog2, mysite.com/blog3, etc. on the same site. But, I want to combine the subdirectories to use one database (and theme, and plugins, etc.) Will this solution work? How can I read my all databases my all subdirectories from main website. I have already created WP Network and I have multiple WordPress website. I am trying to how can read all database from main website. For example: I have "watches.website.com" sub-domain and I have here some products. I want to try to call that's products from "website.com" with search. Can I do that like this? But it's not only one sub-domain. I have more sub-domains. I am trying to like pricegrabber.com or ebay.com They have sub-domains too. But they are managing all sub-domains from main website.


Permalinks that go to a specific template

This is actually my first question here, so hello to everybody in this community! I have developed a theme with a custom post type and a template (lets call it "my_template.php") that shows posts of this custom post type in an archive- like fashion. What I'm trying to achieve is to make a permalink in the navigation of the site that goes to a specific template (like "my_template.php") and ignoring the wp template hierarchy. How could one do that? Note: I've already checked out This answer, but that one didn't really help and provided only a workaround. Thanks!


Thumbnail remove width & height function

I wish that when the browser was resized to below 980px, my images were width 100%. The container of the images already have 100%, the problem is that I'm using wordpress size code for thumbnails:               add_theme_support ('post-thumbnails');     add_image_size ('portfolio1', 600, 344, true);      So I thought to use this code to remove the image sizes:               jQuery (document). ready (function ($) {          $ ('img'). RemoveProp ('width'). RemoveProp ('height');     });      The problem is that I do not know how it would look for smaller sizes that 980px browser. I do not know if this is the best way. I Would like some help Thank you