$wp_query->max_num_pages

I have a pbd-ajax-load-posts plugin, and I'm using the portfolio. But `$wp_query->max_num_pages` is 0 - why? My `pbd-ajax-load-posts.php` code is:               <?php     /**      * Plugin Name: PBD AJAX Load Posts      * Plugin URI: http://www.problogdesign.com/      * Description: Load the next page of posts with AJAX.      * Version: 0.1      * Author: Pro Blog Design      * Author URI: http://www.problogdesign.com/      */          /**      * Initialization. Add our script if needed on this page.      */     function pbd_alp_init()     {         global $wp_query;              $pagina = get_post( $post )->post_name;              // Add code to index pages.         if( $pagina == 'our-portfolio' ) {                   // Queue JS and CSS             wp_enqueue_script(                 'pbd-alp-load-posts',                  plugin_dir_url( __FILE__ ) . 'js/load-posts.js',                  array('jquery'),                  '1.0',                  true             );                  wp_enqueue_style(                 'pbd-alp-style',                 plugin_dir_url( __FILE__ ) . 'css/style.css',                 false,                 '1.0',                 'all'             );                  // What page are we on? And what is the pages limit?             //$max=6;                  $max = $wp_query->max_num_pages;                  $paged = ( get_query_var('paged') > 1 ) ? get_query_var('paged') : 1;                  // Add some parameters for the JS.             wp_localize_script(                 'pbd-alp-load-posts',                 'pbd_alp',                 array(                     'startPage' => $paged,                     'maxPages' => $max,                     'nextLink' => next_posts($max, false),                     'linguaCorrente' => qtrans_getLanguage()                 )             );         }      }           add_action('template_redirect', 'pbd_alp_init');      ?>


Saving meta box data?

All I really want is for the meta box data to be saved A) as an accessible global variable inside the loop and B) to save the data to the textbox so that when the user presses update what they have written appears in the textbox once updated. Currently, i know it doesn't fit the criteria for B), and I'm not sure whether or not it is accessible as a global variable in the loop. Any help?               add_action( 'add_meta_boxes', 'testimonial_text_box' );          function testimonial_text_box() {         add_meta_box(              'testimonial_text_box',             __( 'Testimonial Text:', 'myplugin_textdomain' ),             'testimonial_text_box_content',             'testimonial',             'normal',             'high'         );     }          function testimonial_text_box_content( $post ) {         $values = get_post_custom( $post->ID );           $text = isset( $values['my_meta_box_text'] ) ? esc_attr( $values['my_meta_box_text'][0] ) : ”;           $selected = isset( $values['my_meta_box_select'] ) ? esc_attr( $values['my_meta_box_select'][0] ) : ”;           $check = isset( $values['my_meta_box_check'] ) ? esc_attr( $values['my_meta_box_check'][0] ) : ”;                wp_nonce_field( plugin_basename( __FILE__ ), 'testimonial_text_box_content_nonce' );       $value = get_post_meta( $post->ID, '_my_meta_value_key', true );       echo '';            _e("Text body of the testimonial:", 'myplugin_textdomain' );       echo ' ';         echo '
';       echo '<textarea align="top" id="testimonial_text" name="testimonial_text" value="'.esc_attr($value).'" style="width:100%;height:200px;margin:5px -20px 3px 0;" /></textarea>';     }          add_action( 'save_post', 'testimonial_text_box_save' );     function testimonial_text_box_save( $post_id ) {              if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )          return;              if ( !wp_verify_nonce( $_POST['testimonial_text_box_content_nonce'], plugin_basename( __FILE__ ) ) )         return;              if ( 'testimonial' == $_POST['post_type'] ) {             if ( !current_user_can( 'edit_page', $post_id ) )             return;         } else {             if ( !current_user_can( 'edit_post', $post_id ) )             return;         }         $testimonial_text = $_POST['testimonial_text'];         update_post_meta( $post_id, 'testimonial_text', $testimonial_text );     }


Check if value is a custom taxonomy category name

I'm needing to check a variable and if the slug doesn't match a custom taxonomy's category slug run a function. I can't wrap my head around what I would need to do in order to get the "categories" of a custom taxonomy in an array and check them against a value. All help is greatly appreciated.


How do I get posts by multiple post ID's?

I've got a string with post ID's: `43,23,65`.   I was hoping I could use `get_posts()` and use the string with ID's as an argument. But I can't find any functions for retrieving multiple posts by ID. Do I really have to do a `WP_query`? I've also seen someone mention using `tag_in` - but I can't find any documentation on this.


Stepping up my game with Wordpress hosting

I'm reaching a point where my clients are demanding robust hosting, but I have little experience of what to offer. I've always dealt with shared hosts like Hostgator, but now that I'm building more service-based sites and mission- critical sites like ecommerce sites, I'm realising that shared just doesn't cut the mustard. Moreoever, I'm developing a website for selling library music online, so I need to know what my options are / should be for hosting on a solid platform. I've read the information here: http://codex.wordpress.org/High_Traffic_Tips_For_WordPress And I'll try WP Super Cache on my music site (which is currently on Hostgator's shared hosting) and I believe the speed of my MySQL queries are probably going to be the real strain on the server and affect speed for anyone searching for music. So my question is what I'd need for sites where the traffic could potentially hit around 5-10,000 hits per day (I know that might seem high, I'm just trying to get an idea). From what I've seen, VPSs and dedicated servers are a lot of work to maintain (for this music site, I have limited resources) so I'm thinking cloud-based scaleable hosting might be the way? If anyone can suggest how I might prepare for high-traffic scenarios in the most economical way, I'd be highly appreciative. Many thanks Osu


Change type of permalinks on TinyMCE link dialogue

I recently ran into a problem when inserting text links into post content, and then updating the target post's slug or changing permalink options - the link in the post content won't get updated. This is only really an issue if you forget where you've put text links to other posts, and so don't update them. So I hit on the idea of somehow altering the Link dialogue in TinyMCE to use shortlinks instread of inserting the full permalink: so `example.com/mypage/somepage` would instead be inserted as `example.com?p=123` This way the content links wouldn't need updating unless you trashed the target post. Does anyone have an idea on how to acheive this - I was hoping there would be a filter for the page results in the link dialogue?


Delete post media except featured image

I'm working on site where post except 'featured image' has also other images. Under certain circumstances I need to delete all images except 'featured image'. Which one the most convenient way to do it? Is it possible to do via `delete_post_media()` function or I should write custom query? Thanks.


Using paginate_links() to generate "1, 2, 3 ... 10, 20, 30, 40... 55" paginations

I found this code :                   // Get total number of pages         global $wp_query;         $total = $wp_query->max_num_pages;         // Only paginate if we have more than one page         if ( $total > 1 )  {              // Get the current page              if ( !$current_page = get_query_var('paged') )                   $current_page = 1;              // Structure of “format” depends on whether we’re using pretty permalinks             $permalinks = get_option('permalink_structure');             $format = empty( $permalinks ) ? '&page=%#%' : 'page/%#%/';             echo paginate_links(array(                   'base' => get_pagenum_link(1) . '%_%',                   'format' => $format,                   'current' => $current_page,                   'total' => $total,                   'mid_size' => 2,                   'type' => 'list'             ));         }      It works ok but it generates pagination like "1, 2, 3 ... LASTPAGENUMBER", I've seen plugins that generate paginations like this "1, 2, 3... 19, 20, 30 ... LASTPAGENUMBER". Can this be achieved using paginate_links() function? I don't want to add a plugin just for this small tweak.


Recommended sidebar / content widths

I'm developing my own theme. Does WordPress recommend or require a minimum or maximum when it comes to the width of the content or sidebar elements of an post, page or archive page? If not, are there any unofficial guidelines?


Dropline menus -- seperators between children only?

I'm working on a custom dropline menu using wp_nav_menu. Using `wp_nav_menu( array( 'theme_location' => 'primary', 'after' => '|' ) );`, I can put separators after every item. However, I'm only wanting them after the child items in the sub-menu. Is there any way I can be more specific about which items have separators, such that only the non-parent items are separated? Thanks!


TwentyTwelve child theme: Incorrect footer menu

I built a child theme of Twenty Twelve, and created a menu called "Footer Menu" in Appearance > Menus. I assigned this menu to the Footer location: ![enter image description here](http://i.stack.imgur.com/TCqX8.png) However, the footer menu in the live site displays the same menu as Primary Menu. I have not changed footer.php:               <footer id="colophon" role="contentinfo">         <div>             <?php wp_nav_menu (array ('theme_location' => 'Footer', 'menu_class' => 'footer-menu' )); ?>         </div>              <div class="site-info">             Copyright © Brinkley & Chesnut         </div><!-- .site-info -->     </footer><!-- #colophon -->      Why is the wrong menu displaying in the footer? **Update** functions.php contains:               function register_my_menus() {         register_nav_menus (             array ('footer-menu' => __ ('Footer'))         );     }      I changed "Footer" to "footer" in both functions.php and footer.php, but the issue remains.


How to create custom user input field and display multiple field values on another page

I would like to allow logged-in readers to submit input through custom fields displayed in posts. There would also be a page that displays all the user's values inputted through the various fields. The ACF plugin doesn't seem to work because the custom field is added at the post author level rather than within the published post that the reader views. For example, a post might tell a story, then ask the user to input what he learned from the story. Another post might teach a principle, then ask the user to input what plan he has made based on that principle. Then the user can go to a page that displays all of that user's (and only that user's) responses.


How to noindex for certain custom post type without using plugins..?

Is there a way to create a noindex (meta robot ) for certain custom post type that i have for my wordpress blog..? Thanks


Next and Previous buttons are not showing on home page for post

I made a theme from PSD to WordPress but the "next"-"previous" buttons are not showing on home page. Here is the code of `single.php`:

                      <?php while ( have_posts() ) : the_post(); ?>                          <?php get_template_part( 'content', get_post_format() ); ?>
<?php _e( 'Post navigation', 'aquaponicfamily' ); ?>
                         <?php previous_post_link( '%link', '' . _x( '←', 'Previous post link', 'aquaponicfamily' ) . ' %title' ); ?>                         <?php next_post_link( '%link', '%title ' . _x( '→', 'Next post link', 'aquaponicfamily' ) . '' ); ?>                                               <?php comments_template( '', true ); ?>                      <?php endwhile; // end of the loop. ?>

          <?php get_sidebar(); ?>     <?php get_footer(); ?>      What the changes are required?


Why is my database import losing text widget data?

I've created a site in WordPress on our development machine. In the theme we're using there are numerous widget zones to display text in (sidebar and front page). I've used simple Text widgets in all of these zones to put our display information. When I migrated the site to production, I used the WP-DB-Backup plugin to take a snapshot of the database. I then edited the resulting .sql file to update all of the file paths and URL references to point to our production site. After creating the database, website, and copying all of the files over to the production site, I run the .sql file from the mysql command prompt to import the data into the new database. However, when I go to the production site, some of the text shows up and some of it doesn't. When I look into the widgets section of the site, the text widgets are missing from some of the widget zones. The text widgets aren't even visible in the "Inactive Widget" zone, they simply aren't there. I've even tried to repeat the process using the BackWPup plugin, noticing that the SQL syntax is different when it dumps the database out. Why am I losing text widget data during the import?


More link - not text

I am using origin theme. This theme writes dots in post end. In functions.php file I saw line with text:               function origin_excerpt_more( $more ) {          return '...';      I changed text to **More...** and instead of dots text changed. I want that text **More...** change to link **More...** And link would be to the post. How do I change this code? My website is popietevirtuveje.lt


a child theme not de-registering a patent javascript file

We're currently rolling out a number (>100) of wordpress sites where we're using a custom child theme and a holding page plugin. Most of our clients use IE8 as their browser (corporate policy) and unfortunately their appears to be a conflict between the holding page plugin and an external javascript file included by the parent theme, set in it's functions.php file.               wp_register_script('iejs', 'http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js');      I've tried to prevent the JS file from being called by adding               wp_deregister_script('iejs');     wp_dequeue_script('iejs');      N.B. I guess using but deregister and dequeue is overkill but I want to be sure I've de-registered it... to the child theme functions.php but that didn't work (prevent the javascript file being called by wp_head), I read somewherre that child themes are called pre the parent theme so I tried               function SAH_dereg() {         wp_deregister_script('iejs');         wp_dequeue_script('iejs');     }     add_action( 'after_setup_theme', 'SAH_dereg' );      to force it to de-register the script after the theme loads but before it displays, but that didn't work either. We could of course just remove the line from the parent theme and ignore any updates until after we've sign off from our clients. But I'd prefer a more elegant solution.


Exclude posts without category from loop

I'm trying to exclude all the posts that doesn't have a category assigned to from the main loop, i searched everywhere and i found a billion ways to exclude some categories or filter from specific category but not what i need to do, is it possibile?


How to add relationships between custom post types?

Let's say i have a sample post called "avatar" in "movie", "trailer", "review" and "details" custom post types. How can i display in the "movie" custom post type the content + links to "trailer", "review" and "details" custom post types ?


How to show only terms by id or slug on edit-tags.php (custom taxonomy manage page) for a custom taxonomy

How can I show only terms by id or slug on edit-tags.php (custom taxonomy manage page) for a custom taxonomy. I am saving term_owner metadata to a table for each term and getting all terms' ids for a specific term_owner. Now I want to show only these terms on edit-tags.php. I have tried list_terms_exclusions filter but seems it doses not work for edit-tags.php?taxonomy={custom_taxonomy_name} or I am missing something. Can anyone help me with a working exapmle? Thanks you.


Closing ajax function file with die() causes error and empty page

Adding `die();` to the end of my ajax function file gives me totally blank page and this error in Firebug: `The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must to be declared in the document or in the transfer protocol.` I scaled down to a very basic ajax function file:               <?php     function show_article(){     $q = $_GET['getid'];          echo strval($q);     }          die();     ?>      Which still gives the empty page and error. Without `die();` at the close, it works as expected but with the extra 0 at the end of the echoed $q value. I'm not sure what is causing this issue. For extra context, here's what I've got in my functions.php file.               function ajaxscripts() {     wp_enqueue_script( 'productajax', get_template_directory_uri().'/js/productajax.js', false, null, false );       wp_localize_script( 'productajax', 'myajax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );     }     add_action('wp_enqueue_scripts', 'ajaxscripts');          $dirName = dirname(__FILE__);     $baseName = basename(realpath($dirName));     require_once ("$dirName/getarticle.php"); //my ajax function file          add_action( 'wp_ajax_nopriv_show_article', 'show_article' );     add_action( 'wp_ajax_show_article', 'show_article' );


Displaying posts from a Category where the Category ID or slug is not known

This may be a really simple question but I've struggled to find an answer either searching here, WP forum or via Google. I have a number of different categories and I would like to use just category.php. At the moment I have to create a thecatname-category.php page for each category but this is not very efficient as my I would have to create a new one every time a new Category was created. So I need to find a workable solution that will display all posts from a selected Category where the category ID is passed to category.php and then display posts from that Category. Hope that makes sense! Thanks, Kev


How do you modify the 'post_parent' of a custom post type?

I want to be able to edit the post_parent of a custom post type. Basically in my use case I want to mimic how WordPress uses attachments: have a custom post type that is sort of a subtype to post or any other post type. WordPress uses the post_parent field on the wp_posts table to link attachments to their parent posts so I want to be able to do the same. I've tried to use wp_update_posts but it seems to time out the connection when I try to call it during a post save. Is there a way of editing the post_parent directly?


Getting top Image From the Gallery and printing out a thumbnail with Exact Dimensions

I'm looking for a plugin that pulls an Image from a Wordpress Posts Gallery (Note NOT the Featured Thumbnail, we have thousands of posts and can't retroactively go back and set a Featured image for each post..) Also some of the plugins I've tested don't let you specify exact dimensions, the Wordpress Get The Image Plugin let's you pull an image from the gallery like I want then you set the width but it tries to maintain proprotions. So basically I need it to do exactly that except not try and maintain proportions but rather do a Zoom Crop if that makes sense.


get_plugins() doesn't work after plugins_loaded

Any idea why the following code               function my_plugin_load()     {         get_plugins();     }     add_action( 'plugins_loaded', 'my_plugin_load' );      Throws this error? > **Fatal error** : Call to undefined function get_plugins() Shouldn't `get_plugins()` be defined after the `plugins_loaded` hook is fired? If not, what would be the proper hook to call? (This hook should initiate the plugin's bootstrap/load process)


Modify loop but keep the original query, what am I doing wrong?

I have a custom post type where I have a taxonomy `cities` and a term `berlin`. Archive can be seen at `example.com/cities/berlin` and it's rendered normally from the `archive.php` template. Now, I want to order them according to a custom field, `start_date` in this case, but still keep the original query around. So that when I navigate to `example.com/cities/newyork` the loop would still work as expected. This is what I have but I only get the `<p>Not Found</p>` in the end. Please help. Thanks :)               <?php     global $query_string; //to keep the original query around     $args = array(       'orderby'  => 'meta_value_num',       'meta_key' => 'start_date',       'order'    => 'DESC'     );     $posts = query_posts($query_string . $args);     if (have_posts()) : while (have_posts()) : the_post();      ?>          do stuff          <?php endwhile; else : ?>
Not Found
     <?php endif; ?>


How could I execute my plugin just in frontend (not in backend)

I don't need my plugin running through wp-admin, including wp-login. How could I prevent it? is_admin works fine but i don't know how to ignore everything related to wp-admin (like wp-login.php). Thanks.


wpquery via ajax

I can reload my page and have php write a new **wpquery** and replace the content on my page, but I really don't want to deal with a new page load. Is there an _easy_ way to send a **wpquery** string (eg `"p=7"`) via **ajax**? Even if I have to make a custom php page to query, that's fine. I'm still new to wordpress so I wanted to make sure there's no easy way to do this before I start taking the "scenic" route. **Thanks.**


Conditional tag to determine if the user is viewing the Add Media (after clicking Add media button)

Is there a WordPress conditional tag for checking if the user is viewing the add media popup after clicking the Add media button? If none, is there an alternative function that can be used? Thanks for any tips and advice.


How to change templates based on URL

Okay, so here's what I'm trying to do but having a hell of a time figuring out. I've got a website that uses the MemberPress plugin. All of those pages by default use the standard default template for each of their dynamically generated pages (i.e. thank you page, checkout page, account page, etc.). Furthermore, these pages are dynamically generated and can not be edited from the admin section to use whatever template you want. So, all of the pages I am trying to change the template for have one thing in common, they all have a URL that has /register/ in it (i.e. www.mywebsite.com/register/page-name-here/. Now I checked through all of the WordPress function references at the bottom of the page here... http://codex.wordpress.org/Function_Reference/is_page I don't see anything I can use to determine if a page URL has /register/ in it but I would like to have some sort of code that I could put within my page.php default template that those pages use. The code would simply say something like... if URL contains /register/ DO NOT include sidebar. Else include sidebar. So in other words, the register pages would not include the sidebar and any other pages would include the sidebar. Make sense?


Using wp_handle_upload() to direct specific path by using $overrides

How do you use `wp_handle_upload` function and `apply_filter` together to upload files on a specific path? What is going to be the override? For example:               $overrides = array('file' => 'C:\\uploads\\filename.pdf','message' => 'File written');     apply_filter('wp_handle_upload',$overrides);      or something like that? Or is this the right code? **The real question in here is: what $overrides can be used as the key to this associative array?**


The plugin generated XXX characters of unexpected output...help?

I am working on a plugin that creates a custom post type and then creates a custom template file for the activated theme. The plugin is done editing. But I've received an error while uploading that says "The plugin generated 265 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin." Here is the code for the main file: http://pastebin.com/jztzG499 What can I do to solve this problem? I have looked through other sites and Stackexchange but none of them were helpful. Please help.


Adding custom image sizes and post types to a plugin or to a theme?

I'm just getting started but want to play around in the right area practicing for a new personal site/theme. Part A: I want to add featured images (and a few new image sizes) to a blog portion of a theme. It feels like all this should be done in the child theme itself, right? Part B: I also want to add a portfolio page template with associated custom post type. (in a custom, plugin, correct?) Would it be ok to still include the page template in the theme? Just looking for the best locations to add this, not the code itself.


Multiple Query_Posts

I am trying to put a query_posts inside a WP_query. Anything after my query_posts doesn't work properly. Here is my code. What am I doing wrong?               <?php         $args = array( 'post_type' => 'product', 'posts_per_page' => 1, 'product_cat' => 'featured' );         $loop = new WP_Query( $args );         while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>

The Latest Issue

             <?php              if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.               the_post_thumbnail();             }              ?>

<?php the_date(); ?>

<?php the_title(); ?>
                 <?php the_content(); ?>
What's Inside:

                 <?php query_posts( array ( 'category_name' => 'Magazine Preview', 'posts_per_page' => 3 ) ); ?>                 <?php while (have_posts()) : the_post(); ?>
                     <a href="<?php $featuredImage = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );  echo $featuredImage;?>" rel="lightbox" title="">                     Photo Preview
                     <?php the_title(); ?>
                 <?php endwhile; ?>

Available Now.
                 For Free.
                      <a href="<?php echo get_post_meta( get_the_ID(), 'magazine_url', true ); ?>" class="button read-it" target="_blank">Read It                  <?php echo get_post_meta($post->ID, 'magazine_url', true); ?>

          <?php endwhile; ?>


Change Twenty Twelve's comment form in a child theme

I have a custom child theme of Twenty Twelve. I want to change the text "Leave a reply" to "Leave a comment", and also remove the website field from the comments form. How can I do this? Thanks.


How to handle large number of images in a post?

I have a load of images - up to 16 per post plus a thumbnail and a logo. I want to figure out what the best way to handle them is. Since I'll be adding new entries quite regularly the number of images in the default uploads directory will get quite large. Is this something I should be concerned about? As far as load times etc. I was going to create a co-gallery post type and attach the gallery images to this post type. Then set the gallery id on the Company edit page ( different post type ) to which the gallery belongs. A little code and I have an image gallery. Or should I consider ( ad figure out how to ) uploading the images to a completely separate location/directory? Would doing this be worth the effort and is it really beneficial? Hope that makes sense. Thanx for your help.


Pagination that includes "view all on one page"

I'm using the code below to create pagination for my post results, it works fine but is it possible to add a "view all posts on one page" button to the pagination? This would presumably override the pagination code and just display everything all posts on one page.               function numeric_pagination ($pageCount = 9, $query = null) {          if ($query == null) {         global $wp_query;         $query = $wp_query;     }          if ($query->max_num_pages <= 1) {         return;     }          $pageStart = 1;     $paged = $query->query_vars['paged'];          // set current page if on the first page     if ($paged == null) {         $paged = 1;     }          // work out if page start is halfway through the current visible pages and if so     move it accordingly     if ($paged > floor($pageCount / 2)) {         $pageStart = $paged - floor($pageCount / 2);     }          if ($pageStart < 1) {         $pageStart = 1;     }          // make sure page start is      if ($pageStart + $pageCount > $query->max_num_pages) {         $pageCount = $query->max_num_pages - $pageStart;     }          ?>
     <?php     if ($paged != 1) {     ?>     <a href="<?php echo get_pagenum_link(1); ?>" class="numbered page-number-first">  ‹ <?php _e('Newest', 'rhinoplasty'); ?>     <?php     }     // first page is not visible...     if ($pageStart > 1) {         //echo 'previous';     }     for ($p = $pageStart; $p <= $pageStart + $pageCount; $p ++) {         if ($p == $paged) {     ?>         <span class="numbered page-number-<?php echo $p; ?> current-numeric-page"><?    php echo $p; ?>     <?php } else { ?>         <a href="<?php echo get_pagenum_link($p); ?>" class="numbered page-number-<?    php echo $p; ?>"><?php echo $p; ?>          <?php         }     }     // last page is not visible     if ($pageStart + $pageCount < $query->max_num_pages) {         //echo "last";     }     if ($paged != $query->max_num_pages) {     ?>         <a href="<?php echo get_pagenum_link($query->max_num_pages); ?>" class="numbered page-number-last"><?php _e('Oldest', 'rhinoplasty'); ?> ›     <?php } ?>
          <?php }      I'm not really sure how to go about doing this, any suggestions would be greatly appreciated. Changing to different pagination code is also fine if that will work better. Just to clarify my question, I want to add a 'view all posts on one page' functionality, basically over-riding the pagination code - this would be done by clicking a "view all" link to the right of the pagination menu ( 4 5 ... last Next >> View All> ). Update - almost there I think: I've added this:               <?php      $Path=$_SERVER['REQUEST_URI'];     $URI='http://sitename.com'.$Path;     $nopage = add_query_arg( 'paged', 'no', $Path );     ?>          <a href="<?php echo $nopage; ?>">View All      Which reloads my page with sitename.com?paged=no, but it still shows pagination - I'm not sure how to override the pagination. UPDATE: Here is how I ended up solving it in case this helps anyone else. After the above code and before the final I added:               if (isset($_GET['viewall']))          {          function view_allposts( $query ) {              $query->set( 'posts_per_page', -1 );          }          add_action( 'pre_get_posts', 'view_allposts' );          }               if(!$_GET['viewall']){ ?>          <a class="numbered" href="<?php  echo add_query_arg( array( 'viewall' => "true" ), get_pagenum_link(1) ); ?>">Show All >>          <?php } ?>      Works perfectly! Thanks for your help on this Kaiser, although I used a different solution I learned a lot from the links you provided.


Removing title tags from each page

hello to all I am newbie to wordpress. I want to remove the title tags from every page.Is there any way to remove that part?Thanks in advance..


Remove portion of header code from home page only

I have this code in the template file `header.php`:               <div class="dynamic-header">         <?php if(function_exists('show_media_header')){ show_media_header(); } ?>     </div>      I want to process that header info on all pages, except for homepage. How I can do this?


How can I add Menu Page to specific user?

I've installed a plugin for my client called uTubeVideo, but he has a user role of editor so the option page of the plugin won't display for him. Initially, i thought I could fix this using the `if( current_user_can('editor'))` and adding the page using `add_menu_page();`. This because I already had limited his backend using this function:               add_action('admin_init', 'my_remove_menu_pages');          function my_remove_menu_pages()     {         global $user_ID;         if (current_user_can('editor')) {             remove_menu_page('edit.php?post_type=slide'); // Slides             remove_menu_page('edit.php?post_type=portfolio'); // Portfolio             remove_menu_page('edit-comments.php'); // Comments             remove_menu_page('plugins.php'); // Plugins             remove_menu_page('themes.php'); // Appearance             remove_menu_page('users.php'); // Users             remove_menu_page('edit.php'); // Posts             remove_menu_page('tools.php'); // Tools         }     }      Sadly I can't get this to work, does anyone know how I can fix this?


Retrieve WordPress' the_content() with jQuery

I'm trying to load some additional images when the user clicks a button. At the moment, I have the following function:               $('a').click(function(){         $( ".gallery-pop-up-container" )         .load( "wp-content/themes/fashion_detail/includes/single/gallery-pop-up.php");     });      and I'm trying to load:               <div class="gallery-page">         <?php the_content(); ?>     </div>      However, I get a PHP error, because it's not sure what the function is:                Fatal error: Call to undefined function the_content()       What would be the best way for me to load `the_content()`?


How to have multiple sections within the same theme options page

For my theme, I have created a Settings Page which is shown in the Appearance menu of Wordpress admin. Now, I have been following this tutorial. Exactly like the tutorial, I have created multiple sections and I face the issue where only the fields of the last section are saved in the DB while the fields of other sections are not saved. I do not want to go for the Tabbed Navigation option - I have too many sections. How do I solve the problem of not being able to save fields of other sections due to the nonce issue?


Wordpress Pretty Permalinks redirecting to home page on iis7

I have my WP site on iis7[Windows server 2008 R2];have explored a lot to find the right solution but nothing worked :( http://cricketclips.net/late-overs-batting-flurry-from-luke-wright-pepsi- ipl-2013-kxip-vs-pw-match-29/ My Url are being rewrite but are redirected to homepage instead of single.php and other pages ( that is index.php instead of single.php or other scripts) Added the following code to web.config in root               <?xml version="1.0" encoding="UTF-8"?>     <configuration>     <system.webServer>     <rewrite>     <rules>     <rule name="WordPress Rule" stopProcessing="true">     <match url=".*" />     <conditions>     <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />     <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />     </conditions>     <action type="Rewrite" url="index.php?page_id={R:0}" />     </rule>     </rules>     </rewrite>     </system.webServer>     </configuration>      but still it didn't work have checked the server for "FCGI" and "URL rewrite module", both are installed. Any help in this regard will be appreciated.


How do I Change the notification email via PHP for Gravity Forms Form?

I've built a Wordpress template file in my custom theme that displays a directory of members from a custom PHP file powered by a MYSQL database. This allows each member to be displayed on a different page displayed from this template. I want to display a contact form powered by Gravity Forms on each member page- all using the same Gravity Form. This way people can send an email to the member through that member's profile page and in a way that keeps their email address private. I was hoping to just use a shortcode but Gravity Form shortcodes does not give the ability to change the notification email address. I could use a Gravity Forms function, but how do I change the notification email within a function? The email address is already set as a PHP string but is set from a non- WordPress included file. I did research this question including at the Gravity Forms support forum but without success. One option recommended to me was to send the notification email address as a hidden field in the form. I want to avoid this because I want to keep this email private. There may be other options open to me but as I am new to Gravity Forms and WordPress I could do with some help! Thanks!


Multiple new posts using XML-RPC?

Is it possible to create multiple posts in one XML-RPC request? I've searched everywhere, but did not find any info. I suppose it isn't possible.


query_posts meta_key with current date

How to query Post with current date month with custom field: Here is my code                   <?php         global $wp_query;         $event_month = get_post_meta($wp_query->post->ID, 'eventdate', true); //format in db 11/17/2010         $event_month = date("n"); //A numeric representation of a month, without leading zeros (1 to 12)         $today= getdate(); ?>              <?php query_posts('meta_key='.$event_month .'&meta_compare&meta_value=' .$today["mon"]);?>          <?php while (have_posts()): the_post(); ?>

<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="bookmark">             <?php the_title(); ?>
           <?php the_content(); //Display the content?>
     <?php endwhile; ?>     <?php wp_reset_query();?>      but it doesn't display the output.. .what I want to display is the event list for the month.. for example if it's November it will display the event list for November and when the month of December comes it will show the event list of December and so on.. . The event list date comes with custom field format like this 11/17/2010 compare to current date here are the additional expected output current date is November and the event list should be like this:               +-----------------------+-------------+     | Event Name            | Date        |     +-----------------------+-------------+     | ABC Market opening    | 11/18/2010  |      | ABC Market Seminar    | 11/25/2010  |      | ABC Market Promo      | 11/29/2010  |      +-----------------------+-------------+      thanks guys


WP Multisite: Adding pages on blog creation by default

I’d like to have a page added by default when a new site is created with WP Multisite. So I have my function that creates two pages:               function my_default_pages() {         $default_pages = array('Impress', 'Contact');         $existing_pages = get_pages();              foreach($existing_pages as $page) {             $temp[] = $page->post_title;         }              $pages_to_create = array_diff($default_pages,$temp);              foreach($pages_to_create as $new_page_title) {             // Create post object             $my_post = array();             $my_post['post_title'] = $new_page_title;             $my_post['post_content'] = 'This is my '.$new_page_title.' page.';             $my_post['post_status'] = 'publish';             $my_post['post_type'] = 'page';                  // Insert the post into the database             $result = wp_insert_post( $my_post );         }     }      And I found out that I have to hook into the `wpmu_new_blog`[1] action that fires when a new site is created.               add_action('wpmu_new_blog', 'my_default_pages');      But I don’t know how make both working together …


Formating the display of a post's date, outside the Loop

I'm using this function to be able to retrieve several data, from outside the Loop:               function get_post_data($postId) {      global $wpdb;      return $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE ID=$postId");     }      ... and then, this to display the date a post was published:               <?php      global $wp_query;     global $thePostID;     $thePostID = $wp_query->post->ID;     $data = get_post_data($thePostID);     echo $data[0]->post_date;     ?>      wich displays something like "2010-06-14 22:36:03" in my sidebar, but I'd like to format it like just "June, 2010" Can it be done?


site is loading fully zoomed in on mobile devices

my website is 980px wide. actually it is built on wordpress. My wordpress theme was initially responsive. Somehow i disabled its responsiveness. after that the website loads fine on desktop but it is loading 100% zoomed in on mobile and tablet devices. So my question is pretty simple. I just want to set the zoom level automatic for all types of devices. Thanks


Wordpress 3.6, searchform.php problems

I have just updated to wordpress 3.6 and my theme seems to be ignoring my searchform.php file. Has this happened to anyone else?


Stop WP from creating "Sample Page" and "Hello World!" post

Is it possible to stop WP from creating the "Sample Page" and "Hello World!" post when creating a new blog?


Nuance in adding CPT and TAX to a submenu

I have a lot of CPT's and custom TAXs and decided to put them into a few submenus. That worked just fine. I'll explain how I did that in a moment but the problem is that when you choose a "new term" or a "new post" the Admin's sidebar menu loses track of being within a submenu and collapses the menu. This doesn't strictly matter as you can add the item and then reopen the admin menu but it's an irritant that I'd like to remove. To help explain my problem, I've included a few screen shots. Here's the Admin menu when I open it to my menu/submenu of "LG RefData / UOM": ![enter image description here](http://i.stack.imgur.com/HYT88.png) So far, all good. BTW, UOM is a a CPT (not a TAX). Now if I click on the "Add New" button at the top of the edit.php page then it brings up the page fine but the Admin menu collapses to look like this: ![enter image description here](http://i.stack.imgur.com/ujPnc.png) So that's the main problem but there is a small corollary which is related to how TAX's behave. In the original screen shot you saw a submenu called "UOM Context" which is a taxonomy. By default clicking on that immediately collapses the Admin menu but I have found a way around that (more on that in a sec) but my solution still leaves the menu looking like this when I click on the "UOM Context" link: ![enter image description here](http://i.stack.imgur.com/pB7HZ.png) Notice that while it's not collapsed it is not highlighting (aka, boldfacing) the submenu choice. So let me show you the code I used to set this up (although it is likely fairly standard code for people trying to do this). The first thing that happens from an execution perspective is the CPT's and TAX's are registered. The trick with the CPT's is to use the "show_in_menu" and set it to name of the menu page it will sit under:                       // Default args             array(                 'label'                 => $plural,                 'labels'                => $labels,                 'public'                => true,                 'show_ui'               => $this->show_menu,                 'show_in_menu'          => $this->show_in_menu,                 'supports'              => array( 'title', 'editor' , 'excerpt'),                 'show_in_nav_menus'     => true,                 'menu_icon'             => LG_FE_DIR . "/img/lg-admin.png",                 'menu_position'         => $this->get_menu_priority(),                 '_builtin'              => false,             ),      Note that this is not necessary for TAX's and in my experimenting it seems to have no effect so I have just left it off. The second step is the add_menu_page and add_submenu_page calls:               add_menu_page ("LG Ref Data", "LG Ref Data", "manage_options", LG_REFDATA_MENU, "LG_AdminMenuSystem::show_reference_menu", plugins_url ("/img/LG.png", __DIR__), 61.1);     add_submenu_page (LG_REFDATA_MENU,"UOMs","UOMs","manage_options",'edit.php?post_type=uoms');     add_submenu_page (LG_REFDATA_MENU,"UOM Context","UOM Context","manage_options",'edit-tags.php?taxonomy=uom-contexts&post_type=uoms');     array_push (self::$tax_correct, "uom-contexts");          Pretty standard stuff with the exception of the last line which is the beginning of my TAX Fix that I mentioned earlier (aka, stops the menu from collapsing when choosing a TAX item but doesn't stop it when adding a new item). Here's the actual code for the fix:               static public function tax_menu_correction ($parent_file) {         global $current_screen;         $taxonomy = $current_screen->taxonomy;         if ( in_array($taxonomy,self::$tax_correct) )             $parent_file = LG_REFDATA_MENU;         return $parent_file;     }      which is then called from the following hook:               add_action( 'parent_file' , 'LG_AdminMenuSystem::tax_menu_correction'); // helps to keep the menu selection on the menu when choosing a custom TAX       So that's it. Any and all help would be greatly appreciated.


Is there a way to delete images from Wordpress media library programmatically?

This is a follow-up of my question which did solve my problem, well, a little bit. I noticed that there are still images on my uploads folder but of different size. Is there a way to delete all traces of the image that I uploaded? It seems that `wp_delete_attachment` only deletes the image that is "attached" but not the other image sizes that Wordpress automatically created. I use this function to generate attachment IDs               function insert_attachment( $file_handler, $post_id, $setthumb='false' ) {              // check to make sure its a successful upload         if ($_FILES[$file_handler]['error'] !== UPLOAD_ERR_OK) __return_false();              require_once(ABSPATH . "wp-admin" . '/includes/image.php');         require_once(ABSPATH . "wp-admin" . '/includes/file.php');         require_once(ABSPATH . "wp-admin" . '/includes/media.php');              $attach_id = media_handle_upload( $file_handler, $post_id );              if ($setthumb) update_post_meta($post_id,'_thumbnail_id',$attach_id);              return $attach_id;       }      (I got that from: http://goldenapplesdesign.com/2010/07/03/front-end-file- uploads-in-wordpress/) I use this for a custom file upload in front-end and not the usual upload using the Media Library. This is for a site that requires user uploads. Any thoughts?


What is good W3 total database caching option?

I have a centOS VPS (Apach+Nginx). Right now I use APC for w3 total plugin cache (disk enhanced for page cache). I have less than 25MB database. I can see several w3tc, APC cache errors. I think the main issue is Zend optimizer. What is the good option for wordperss database cache (eAccelerator, XCache)? Error.               PHP Strict Standards:  Declaration of W3_Cache_Apc::delete() should be compatible with W3_Cache_Base::delete($key, $group = '') in /home/xxxxx/public_html/wp-content/plugins/w3-total-cache/lib/W3/Cache/Apc.php on line 189


Page content doesn't display when published but does when previewed as draft?

I have a page called ecommerce which is published. It's not private or password protected. When I view the page I only see the page title in the body none of the content. If I preview the published page nothing shows up only the title. If I set the status of the page to Draft and preview the page it'll display the content correctly. If I change the permalink slug it will display fine when published. I had a page before with this name trashed and permanently deleted it. It seems something might have got left over in the database?


How to create custom query by keyword in post title?

I need some help regarding Custom Query by keyword. I send a keyword to my page where I would like to list those posts which post_title contains the keyword I sent. Here comes my query as follows:               $q = 'SELECT guid, post_content, post_title, post_parent, post_type FROM wp_posts WHERE (post_title REGEXP '".$keyword."') AND post_type="attachment"';      How would it be possible to implement it into Wordpress and make it work? I have seen many snipets but it's really hard for me to make it work. I have found a code which seemed good, but the displaying part is missing, please see at the end of this question.               global $wpdb;     // If you use a custom search form     $keyword = sanitize_text_field( $_REQUEST['mykey'] );     // If you use default WordPress search form     // $keyword = get_search_query();     $keyword = "%{$keyword}%";     // Search in all custom fields     $post_ids_meta = $wpdb->get_col( $wpdb->prepare( "     SELECT DISTINCT post_id FROM {$wpdb->postmeta}     WHERE meta_value LIKE '%s'     ", $keyword ) );     // Search in post_title and post_content     $post_ids_post = $wpdb->get_col( $wpdb->prepare( "     SELECT DISTINCT ID FROM {$wpdb->posts}     WHERE post_title LIKE '%s'     OR post_content LIKE '%s'     ", $keyword, $keyword ) );     $post_ids = array_merge( $post_ids_meta, $post_ids_post );     // Query arguments     $args = array(     'post_type' => 'post',     'post_status' => 'publish',     'post__in' => $post_ids,     );     $query = new WP_Query( $args );     if ( $query->have_posts() ): while ( $query->have_posts() ) : $query->the_post();     // Do loop here     endwhile; endif;


How to prefill Wordpress registration with Social

I created custom registration process in wordpress with a lot of extra fields like first name, last name etc. I would like to make integration with facebook/linkedin so first name,last name,email, fields are be prefilled with facebook/ linkedin, but still users will need enter other fields to finish registaration. Is it possible to do something like that, or is there some plugin which is doing that?


How to Show Different Sidebars on Specific Pages?

I'm making a blog where only on specific pages I want to show different sidebar, I will add some widgets to those sidebar, which I don't want to show in default sidebar. I've found a coding method to do this, but I would like to use a plugin, and not edit code myself. I need to give the control of adding/removing sidebar/widgets in client hands. So is there any plug-in to do this easily?


apply custom where to the default $wp_query

I can read on the docs that if I need to perform a custom WHERE on WP_Query I need to do the following:               // Create a new filtering function that will add our where clause to the query     function filter_where( $where = '' ) {         // posts  30 to 60 days old         $where .= " AND post_date >= '" . date('Y-m-d', strtotime('-60 days')) . "'" . " AND post_date <= '" . date('Y-m-d', strtotime('-30 days')) . "'";         return $where;     }          add_filter( 'posts_where', 'filter_where' );     $query = new WP_Query( $query_string );     remove_filter( 'posts_where', 'filter_where' );      **BUT** what If I need to apply such a WHERE condition on the default query? I already have other conditions being applied during a `pre_get_posts`, something like this:               function homepage_load_posts($query) {       if ($query->is_home()) {         $params = querystring_var('filter');               $query->query_vars['post_type'] = array('blog_post', 'post', 'dossier');          $query->query_vars['posts_per_page'] = 12;               if ($params) {           $valid_categories = valid_categories($params['cat']);           $valid_formats    = valid_formats($params['format']);           $valid_post_types = valid_post_types($params['type']);                if ($valid_categories) $query->query_vars['cat'] = $valid_categories;            if ($valid_formats)    $query->query_vars['tax_query'] = $valid_formats;            if ($valid_post_types) $query->query_vars['post_type'] = $valid_post_types;              }       }     }          add_action('pre_get_posts', 'homepage_load_posts');


Merging two Custom Post Types into one

I am new to all this so my ignorance may get in the way. I inherited a WP Blog with Custom Post Types. There are 4 Custom Post Types, out of which 2, **Books** and **Magazines** , have the same fields: Custom_Post_Type_Name, Author, City, Address, Categories, Tags, Date. I need to merge these two Custom Post Types into one. More specifically, I need to merge **Books** into **Magazines** and rename this new merged Custom Post Type to **Publications**. Can someone please show me how to do this?


How can I disable/hide certain themes in multisite? I only want certain themes to be used for now.


Only show theme option if it option exists

I have a slideshow in a custom theme I am developing and I am using the UpThemes Framework, what I want to know is, is there a way and image will only display if it has been defined? For example, at the moment the max. number of images in the slideshow is 6, but if only 5 are uploaded the "alt" attribute displays for the 6th For those unfamiliar with the framework, this is the PHP tag I am using               <?php echo $up_options->slideshow6; ?>      I have done this with custom fields in the past but I can't for the life of me figure out how I did it.


How to define %category% for custom taxonomies?

So when you put %category% in the permalink structure that tag will be replaced with the path from the root category to the furthest subcategory, where, when placed in multiple categories, it will take the category order in account. So how is this possible for custom taxonomies? I came up with the following code: http://pastebin.com/pVyKzryS I was wondering if someone had a better way to accomplish the same?


Convert a Multisite Wordpress install into a Single site

Given a wordpress multisite network, with a main blog, and assuming all content has been moved on to that blog, how would one collapse the network back down into a standard wordpress non-network non-multisite install?


Override database config for WordPress multisite

Our team has run in to a problem working with WordPress 3 multisite. We usually work with a local copy of the site (localhost/testsite) but with the same database to keep all changes up to date. This works fine in a single install because you can override the database configs from PHP with:               define( 'URL', $path );       define( 'WP_HOME', $path );       define( 'WP_SITEURL', $path );       define( 'WP_CONTENT_URL', $path . '/wp-content' );        But this doesn't work on the multisite because of the extra tables (`wp_blogs`, `wp_site`) and they have the path to the blog in their settings. Does anyone know how to override these settings? I would like the site to run on domain **localhost** for our developers, **developerdomain.com** for our test servers and then **realdomain.com** when the site goes live. It feels kind of like overkill if we have to set up different databases for each of them and change the domain and path manually and then copy the post, blog and user data between the databases to do debugging and continue the development...


Sort posts by newest child while keeping hierarchy intact

I have the following hierarchy within my wordpress posts (e.g.):               -> Post 1 (pubdate: 2011-01-01)      --> Post 5 (pubdate: 2011-01-02)       ---> Post 6 (pubdate: 2011-01-03)        ----> Post 7 (pubdate: 2011-01-04)          -> Post 2 (pubdate: 2011-03-01)      --> Post 8 (pubdate: 2011-03-02)          -> Post 3 (pubdate: 2011-02-01)      --> Post 9 (pubdate: 2011-02-02)       ---> Post 10 (pubdate: 2011-02-03)          -> Post 4 (pubdate: 2011-04-01)      What I now would like to achieve is to sort the parent posts by the publish date of the newest respective child post. The important thing is that the hierarchy should stay intact. This would lead to the following order in the example (from newest to oldest):               -> Post 4 (pubdate: 2011-04-01)          -> Post 2 (pubdate: 2011-03-01)      --> Post 8 (pubdate: 2011-03-02)          -> Post 3 (pubdate: 2011-02-01)      --> Post 9 (pubdate: 2011-02-02)       ---> Post 10 (pubdate: 2011-02-03)          -> Post 1 (pubdate: 2011-01-01)      --> Post 5 (pubdate: 2011-01-02)       ---> Post 6 (pubdate: 2011-01-03)        ----> Post 7 (pubdate: 2011-01-04)      Any idea how I can get this working? Thanks! **EDIT:** I added the following part based on the question of Rarst on how i retrieve the structure. I retrieve the posts with the following query:               $args = array(       'cat' => 7,       'post_type' => 'articles',        'orderby' => 'post_date',        'posts_per_page' => -1,        'order' => 'DESC'      );      $records = get_posts($args);     foreach($records as $post) {       get_template_part( 'index', 'article' );     } I then use this function to check how many parents an article has...               // count amount of parents of a post     function usr_count_children($cid) {       $childrenArray = count(get_pages("post_type=articles&child;_of=".$cid));       return $childrenArray;     } ...and add the returned number as css class to the html element of the article (which is then styled based on that). **EDIT 2:** Ok, that's what I've got so far:                   $parentPosts = get_posts(array(         'cat' => 7,          'post_type' => 'articles',         'post_status' => 'publish',         'post_parent' => 0,          'posts_per_page' => -1,         'orderby' => 'post_date',         'order' => 'DESC' ));          foreach ($parentPosts as $post){              echo "+ ".$post->post_title." ID: ".$post->ID."
";              // Look up newest child (query, sort by date, limit to one)         $newestChild = get_pages(array(             'child_of' => $post->ID,             'post_type' => 'articles',             'post_status' => 'publish',             'sort_column' => 'post_date',             'sort_order' => 'DESC',             'number' => 1 ));              foreach($newestChild as $child){             echo "– ".$child->post_title." ID: ".$child->ID."
";         }     }      I'm stuck with the second query (get newest child), it wont return any children unless I remove `'number' => 1`. I really tried a few things (like using WP_Query instead, I even tried raw SQL queries) but I can't get my head around it. Anyone?


query posts returns 10 records

I am using the following code to fetch records from a custom taxonomy.               if ($_GET['post_type'] == "developments"){ ?>                         <?php                          global $wp_query;                         $paged = $wp_query->query_vars['paged'];                              $development_args = array(                             'post_type' => $_GET['post_type'],                             'orderby' =>'title',                             'order' => 'ASC',                             'posts_per_page' => 14,                             'paged' => $paged,                              's' => $_GET['search_building_name'],                         );                         $development_args['meta_query'] = array(                             'relation'=>'AND',                             array(                                 'key' => 'total_units',                                 'type' => 'numeric',                                 'value' => $_GET['search_total_units'],                                 'compare' => $_GET['total_units_operator']                             ),                             array(                                 'key' => 'total_floors',                                 'type' => 'numeric',                                 'value' => $_GET['search_total_floors'],                                 'compare' => $_GET['total_floors_operator']                             ),                         );                         $development_args['tax_query'] = array(                             'relation' => 'AND',                             array(                                 'taxonomy' => 'type',                                 'field' => 'slug',                                 'terms' => $_GET['search_type'],                                 //'operator' => 'AND'                             ),                             array(                                 'taxonomy' => 'amenities',                                 'field' => 'slug',                                 'terms' => $_GET['search_amenities'],                                 'operator' => 'AND'                             ),                             array(                                 'taxonomy' => 'style',                                 'field' => 'slug',                                 'terms' => $_GET['search_style'],                                 'operator' => 'AND'                             ),                         );                         if ($_GET['search_neighborhood'] != 'any'){                         $development_args['tax_query'][] = array(                                 'taxonomy' => 'neighborhood',                                 'field' => 'slug',                                 'terms' => $_GET['search_neighborhood'],                             );                         }                         if ($_GET['search_developer'] != 'any'){                         $development_args['tax_query'][] = array(                                 'taxonomy' => 'developer',                                 'field' => 'slug',                                 'terms' => $_GET['search_developer'],                             );                         }                                                if ($_GET['search_architect'] != 'any'){                         $development_args['tax_query'][] = array(                                 'taxonomy' => 'architect',                                 'field' => 'slug',                                 'terms' => $_GET['search_architect'],                             );                         }                                                if ($_GET['search_delivered'] != 'any'){                         $development_args['tax_query'][] = array(                                 'taxonomy' => 'delivered',                                 'field' => 'slug',                                 'terms' => $_GET['search_delivered'],                             );                         }                                                     query_posts($development_args );                     }      $wp_query->post_count returns 10, even when the actual number of records is lot more. I have tried various solutions but none work for me. This question could be a duplicate but i am asking this again because even a few answers have worked for other people but none have given a good explanation. Thanks


Can the wp-plugins (Must Use Plugins) URL be targeted for use in functions.php? I have a mu-functions.php file in the mu-plugins folder. One function calls a javascript file (`alerts.js`) located in `example.com/wp- content/mu-plugins/js/`. How can I target the mu-plugins folder in my function? Currently, I am using `get_site_url() . '/wp-content/mu- plugins/js/alerts.js',` Although not completely relevant to the question, this is the complete function used to call the javascript file:               function load_my_alerts(){           wp_register_script(              'my_alerts',              get_site_url() . '/wp-content/mu-plugins/js/alerts.js',              array( 'jquery' )         );         wp_enqueue_script( 'my_alerts' );     }     add_action('admin_enqueue_scripts', 'load_my_alerts');


What possible reasons can cause my plugin not to be listed in the plugin search in the back-end of wordpress installs?

our plugin is listed on wordpress.org but it can't be found if you go in the backend of a WP install and search for it under Plugins -> Add New. Our plugin was delisted some time ago from wordpress.org but now it's listed again, why is it not appearing in search results? This is the body of the all-in-one-event-calendar.php file               <?php     /**      * Plugin Name: All-in-One Event Calendar by Timely      * Plugin URI: http://time.ly/      * Description: A calendar system with month, week, day, agenda views, upcoming events widget, color-coded categories, recurrence, and import/export of .ics feeds.      * Author: Timely      * Author URI: http://time.ly/      * Version: 1.10      */     @set_time_limit( 0 );     @ini_set( 'memory_limit',           '256M' );     @ini_set( 'max_input_time',         '-1' );          // ===============     // = Plugin Name =     // ===============     define( 'AI1EC_PLUGIN_NAME',        'all-in-one-event-calendar' );          // ===================     // = Plugin Basename =     // ===================     define( 'AI1EC_PLUGIN_BASENAME',    plugin_basename( __FILE__ ) );          // ==================     // = Plugin Version =     // ==================     define( 'AI1EC_VERSION',            '1.10' );          // ====================     // = Database Version =     // ====================     define( 'AI1EC_DB_VERSION',         109 );          // ==========================     // = Bundled themes version =     // ==========================     define( 'AI1EC_THEMES_VERSION',     8 );          // ================     // = Cron Version =     // ================     define( 'AI1EC_CRON_VERSION',       104 );     define( 'AI1EC_N_CRON_VERSION',     103 );     define( 'AI1EC_N_CRON_FREQ',        'daily' );     define( 'AI1EC_UPDATES_URL',        'http://time.ly/plugin/standard/latest' );          // ===============     // = Plugin Path =     // ===============     define( 'AI1EC_PATH',               dirname( __FILE__ ) );          // ===================     // = CSS Folder name =     // ===================     define( 'AI1EC_CSS_FOLDER',         'css' );          // ==================     // = JS Folder name =     // ==================     define( 'AI1EC_JS_FOLDER',          'js' );          // =====================     // = Image folder name =     // =====================     define( 'AI1EC_IMG_FOLDER',         'img' );          // ============     // = Lib Path =     // ============     define( 'AI1EC_LIB_PATH',           AI1EC_PATH . '/lib' );          // =================     // = Language Path =     // =================     define( 'AI1EC_LANGUAGE_PATH',      AI1EC_PLUGIN_NAME . '/language' );          // ============     // = App Path =     // ============     define( 'AI1EC_APP_PATH',           AI1EC_PATH . '/app' );          // ===================     // = Controller Path =     // ===================     define( 'AI1EC_CONTROLLER_PATH',    AI1EC_APP_PATH . '/controller' );          // ==============     // = Model Path =     // ==============     define( 'AI1EC_MODEL_PATH',         AI1EC_APP_PATH . '/model' );          // =============     // = View Path =     // =============     define( 'AI1EC_VIEW_PATH',          AI1EC_APP_PATH . '/view' );          // ====================     // = Admin Theme Path =     // ====================     define( 'AI1EC_ADMIN_THEME_PATH',   AI1EC_VIEW_PATH . '/admin' );          // ==================     // = Admin theme CSS path =     // ==================     define( 'AI1EC_ADMIN_THEME_CSS_PATH', AI1EC_ADMIN_THEME_PATH . '/' . AI1EC_CSS_FOLDER );          // =======================     // = Admin theme JS path =     // =======================     define( 'AI1EC_ADMIN_THEME_JS_PATH', AI1EC_ADMIN_THEME_PATH . '/' . AI1EC_JS_FOLDER );          // ========================     // = Admin theme IMG path =     // ========================     define( 'AI1EC_ADMIN_THEME_IMG_PATH', AI1EC_ADMIN_THEME_PATH . '/' . AI1EC_IMG_FOLDER );          // ===============     // = Helper Path =     // ===============     define( 'AI1EC_HELPER_PATH',        AI1EC_APP_PATH . '/helper' );          // ==================     // = Exception Path =     // ==================     define( 'AI1EC_EXCEPTION_PATH',     AI1EC_APP_PATH . '/exception' );          // ==============     // = Plugin Url =     // ==============     define( 'AI1EC_URL',                plugins_url( '', __FILE__ ) );          // ==============     // = Images URL =     // ==============     define( 'AI1EC_IMAGE_URL',          AI1EC_URL . '/' . AI1EC_IMG_FOLDER );          // ===========     // = CSS URL =     // ===========     define( 'AI1EC_CSS_URL',            AI1EC_URL . '/' . AI1EC_CSS_FOLDER );          // ==========     // = JS URL =     // ==========     define( 'AI1EC_JS_URL',             AI1EC_URL . '/' . AI1EC_JS_FOLDER );          // ================     // = Admin JS URL =     // ================     define( 'AI1EC_ADMIN_THEME_JS_URL', AI1EC_URL . '/app/view/admin/' . AI1EC_JS_FOLDER );          // =================     // = Admin CSS URL =     // =================     define( 'AI1EC_ADMIN_THEME_CSS_URL', AI1EC_URL . '/app/view/admin/' . AI1EC_CSS_FOLDER );          // =================     // = Admin IMG URL =     // =================     define( 'AI1EC_ADMIN_THEME_IMG_URL', AI1EC_URL . '/app/view/admin/' . AI1EC_IMG_FOLDER );          // =============     // = POST TYPE =     // =============     define( 'AI1EC_POST_TYPE',          'ai1ec_event' );          // =====================================================     // = UPDATE THEMES PAGE BASE URL (wrap in admin_url()) =     // =====================================================     define( 'AI1EC_UPDATE_THEMES_BASE_URL', 'edit.php?post_type=' . AI1EC_POST_TYPE . '&page=' . AI1EC_PLUGIN_NAME . '-update-themes' );          // =====================================================     // = FEED SETTINGS PAGE BASE URL (wrap in admin_url()) =     // =====================================================     define( 'AI1EC_FEED_SETTINGS_BASE_URL', 'edit.php?post_type=' . AI1EC_POST_TYPE . '&page=' . AI1EC_PLUGIN_NAME . '-feeds' );          // ================================================     // = SETTINGS PAGE BASE URL (wrap in admin_url()) =     // ================================================     define( 'AI1EC_SETTINGS_BASE_URL',  'edit.php?post_type=' . AI1EC_POST_TYPE . '&page=' . AI1EC_PLUGIN_NAME . '-settings' );          // ======================     // = Default Theme Name =     // ======================     define( 'AI1EC_DEFAULT_THEME_NAME', 'vortex' );          // =============================     // = Default Theme folder name =     // =============================     define( 'AI1EC_THEMES_FOLDER',      'themes-ai1ec' );          // ========================     // = AI1EC Theme location =     // ========================     define( 'AI1EC_THEMES_ROOT',        WP_CONTENT_DIR . '/' . AI1EC_THEMES_FOLDER );          // ===================     // = AI1EC Theme URL =     // ===================     define( 'AI1EC_THEMES_URL',         WP_CONTENT_URL . '/' . AI1EC_THEMES_FOLDER );          // ======================     // = Default theme path =     // ======================     define( 'AI1EC_DEFAULT_THEME_PATH', AI1EC_THEMES_ROOT . '/' . AI1EC_DEFAULT_THEME_NAME );          // =====================     // = Default theme url =     // =====================     define( 'AI1EC_DEFAULT_THEME_URL',  AI1EC_THEMES_URL . '/' . AI1EC_DEFAULT_THEME_NAME );          // ======================================================     // = INSTALL THEMES PAGE BASE URL (wrap in admin_url()) =     // ======================================================     define( 'AI1EC_INSTALL_THEMES_BASE_URL', 'themes.php?page=' . AI1EC_PLUGIN_NAME . '-install-themes' );          // ================     // = RSS FEED URL =     // ================     define( 'AI1EC_RSS_FEED',           'http://time.ly/feed/' );          // ======================================     // = FAKE CATEGORY ID FOR CALENDAR PAGE =     // ======================================     define( 'AI1EC_FAKE_CATEGORY_ID',   -4113473042 ); // Numeric-only 1337-speak of AI1EC_CALENDAR - ID must be numeric          // ==============     // = SCRIPT URL =     // ==============     $ai1ec_script_url = get_option( 'home' ) . '/?plugin=' . AI1EC_PLUGIN_NAME;     define( 'AI1EC_SCRIPT_URL',         $ai1ec_script_url );          // ====================================================     // = Convert http:// to webcal:// in AI1EC_SCRIPT_URL =     // =  (webcal:// protocol does not support https://)  =     // ====================================================     $tmp = str_replace( 'http://', 'webcal://', AI1EC_SCRIPT_URL );          // ==============     // = EXPORT URL =     // ==============     define( 'AI1EC_EXPORT_URL',         $tmp . "&controller=ai1ec_exporter_controller&action=export_events&cb=" . rand() );          // ====================================     // = Include iCal parsers and helpers =     // ====================================     if( version_compare( PHP_VERSION, '5.3.0' ) >= 0 ) {         // Parser that requires PHP v5.3.0 or up         require_once( AI1EC_LIB_PATH . '/iCalcreator-2.14/iCalcreator.class.php' );     } else {         // Parser that works on PHP versions below 5.3.0         require_once( AI1EC_LIB_PATH . '/iCalcreator-2.10/iCalcreator.class.php' );         require_once( AI1EC_LIB_PATH . '/iCalcreator-2.10/iCalUtilityFunctions.class.php' );     }     require_once( AI1EC_LIB_PATH . '/SG_iCal.php' );     require_once( AI1EC_LIB_PATH . '/helpers/SG_iCal_Line.php' );     require_once( AI1EC_LIB_PATH . '/helpers/SG_iCal_Duration.php' );     require_once( AI1EC_LIB_PATH . '/helpers/SG_iCal_Freq.php' );     require_once( AI1EC_LIB_PATH . '/helpers/SG_iCal_Recurrence.php' );     require_once( AI1EC_LIB_PATH . '/helpers/SG_iCal_Parser.php' );     require_once( AI1EC_LIB_PATH . '/helpers/SG_iCal_Query.php' );     require_once( AI1EC_LIB_PATH . '/helpers/SG_iCal_Factory.php' );     // include our global functions     require_once( AI1EC_LIB_PATH . '/global-functions.php' );          // ===============================     // = The autoload function =     // ===============================     function ai1ec_autoload( $class_name )     {         // Convert class name to filename format.         $class_name = strtr( strtolower( $class_name ), '_', '-' );         $paths = array(             AI1EC_CONTROLLER_PATH,             AI1EC_MODEL_PATH,             AI1EC_HELPER_PATH,             AI1EC_EXCEPTION_PATH,             AI1EC_LIB_PATH,             AI1EC_VIEW_PATH,             AI1EC_ADMIN_THEME_PATH,             get_option( 'ai1ec_current_theme_path', AI1EC_DEFAULT_THEME_PATH ),             AI1EC_DEFAULT_THEME_PATH         );              // remove duplicates from the paths array         $paths = array_unique( $paths );              // Search each path for the class.         foreach( $paths as $path ) {             if( file_exists( "$path/class-$class_name.php" ) )                 require_once( "$path/class-$class_name.php" );         }     }     spl_autoload_register( 'ai1ec_autoload' );          // ===============================     // = Initialize and setup MODELS =     // ===============================     global $ai1ec_settings;          $ai1ec_settings = Ai1ec_Settings::get_instance();               // ================================     // = Initialize and setup HELPERS =     // ================================     global $ai1ec_view_helper,            $ai1ec_settings_helper,            $ai1ec_calendar_helper,            $ai1ec_app_helper,            $ai1ec_events_helper,            $ai1ec_importer_helper,            $ai1ec_exporter_helper;          $ai1ec_view_helper     = Ai1ec_View_Helper::get_instance();     $ai1ec_settings_helper = Ai1ec_Settings_Helper::get_instance();     $ai1ec_calendar_helper = Ai1ec_Calendar_Helper::get_instance();     $ai1ec_app_helper      = Ai1ec_App_Helper::get_instance();     $ai1ec_events_helper   = Ai1ec_Events_Helper::get_instance();     $ai1ec_importer_helper = Ai1ec_Importer_Helper::get_instance();     $ai1ec_exporter_helper = Ai1ec_Exporter_Helper::get_instance();          // ====================================     // = Initialize and setup CONTROLLERS =     // ====================================     global $ai1ec_app_controller,            $ai1ec_settings_controller,            $ai1ec_events_controller,            $ai1ec_calendar_controller,            $ai1ec_importer_controller,            $ai1ec_exporter_controller,            $ai1ec_themes_controller;          $ai1ec_settings_controller  = Ai1ec_Settings_Controller::get_instance();     $ai1ec_events_controller    = Ai1ec_Events_Controller::get_instance();     $ai1ec_calendar_controller  = Ai1ec_Calendar_Controller::get_instance();     $ai1ec_importer_controller  = Ai1ec_Importer_Controller::get_instance();     $ai1ec_exporter_controller  = Ai1ec_Exporter_Controller::get_instance();     $ai1ec_themes_controller    = Ai1ec_Themes_Controller::get_instance();          // ==========================================================================     // = All app initialization is done in Ai1ec_App_Controller::__construct(). =     // ==========================================================================     $ai1ec_app_controller      = Ai1ec_App_Controller::get_instance();


get multiple values from $_GET from multiple checkboxes

I'm creating a form that loops through all the terms of a taxonomy. Multiple terms can be selected and they get passed in the url. I'm trying to get all the terms on another page but I'm only able to get the last one. I'm not sure if this is the best way to do this but if anyone can give me a tip as to what I'm doing wrong. First, here is the form                                       <form method="get" id="searchProperties" action="<?php echo home_url()?>/filter-2/?">                                 <?php                             $termsCounty = get_terms( 'County', array(                                   'hide_empty' => 0                                   ) );                             echo '
';                                 foreach ($termsCounty as $term) {                                     $termCounty = $term->name . 'PropertyFilter';                                     echo '
<input type="checkbox" name="t"  value="il_' . $term->name . '">' .$term->name. '
';                                 }                             echo '
';                                  ?><input type="submit" value="FILTER"/>                             </form>      And here is where the choices are accessed:               echo $term = $_GET['t'];      Any suggestions? Thanks in advance!


Sublime Video: Playlist which gets all attached videos

I searched a way to automatically load all attached videos in a custom post type as SublimeVideo playlist. After some time I got it working and here I'll share the code with everyone who is interested to do it the same way.


Eliminating the appearance of a specific custom field in a post

I would like to suppress the output of one of my custom fields. Is there a way to do this using the `<?php the_meta(); ?>`command?


Reproducing hierarchical list output from wp_list_categories, using get_categories()

I need more control over the category listing output, so I'm using get_categories (http://codex.wordpress.org/Function_Reference/get_categories), instead of wp_list_categories (http://codex.wordpress.org/Template_Tags/wp_list_categories). This function returns a flat array of objects ordered by a certain attribute. How can I build a hierarchical list from it like wp_list_categories() does?


Adding HTML to the Header, Screws up in IE7

Working on a site for a client: http://esteyprinting.jasinternetmarketing.com/ I added an HTML table to header.php to include the "Call us at..." and the social media icons. It renders fine in most browsers but IE7 screws up that table. I ran it through the W3C validator and that part of the code is fine. You can see what I mean by putting the above URL into: http://ipinfo.info/netrenderer/ Any ideas for how to solve the problem? Thanks! Jim


get_comments_number of depth-1 (Level 1) (1 post)

I selected only 2 levels of comment for my wordpress site. How can I display the number of comment of the first level ? (Depth-1)


Passing variables trough 2 pages

I am creating a plugin. In this plugin I have shortcodes that provide some logic and content for pages. This way I have created 'Page A' and 'Page B'. Both of the pages will redirect user to external page. The external page is not written by me and will not process any of my $_GET or $_POST values. Then this external page will redirect user back to my plugin 'Page C'. Now how to make 'Page C' know if the external page was reached from 'Page A' or 'Page B'? Normally I would use sessions, but I have read that wordpress does not support sessions. How can I do it then? HoGo


How to handle a "Error establishing a database connection"?

For a little project i am using WP by loading               require( '../site/wp-load.php');      When the local msyql server is running everything works great. But in certain situations the local mysql server isn't running or the password isn't correct and the Response Header reads `Error establishing a database connection` How can i catch this error and output a custom message as the frontend of this project looks like it's running ok?


Adding CSS to custom post type admin page causes error

I have this bit of code in my Meteor Slides plugin that loads a stylesheet on the admin pages of just the slides custom post type:                   add_action('admin_head', 'meteorslides_admin_css');          function meteorslides_admin_css() {              global $post_type;              if (($_GET['post_type'] == 'slide') || ($post_type == 'slide')) :                  echo "<link type='text/css' rel='stylesheet' href='" . plugins_url('/css/meteor-slides-admin.css', __FILE__) . "' />";              endif;          }      This code works fine and hasn't cause any issues, but in debug mode, it does cause this error that I'd like to resolve:               // Notice: Undefined index: post_type in C:\Program Files\xampp\htdocs\slides\wp-content\plugins\meteor-slides-1.3\meteor-slides-plugin.php on line 476      I haven't been able to fix this error, does anyone have any suggestions, or a different way to add a stylesheet to the admin pages of a certain post type?


Using page title as a link to term archive

i want to do something like that (pay attention to line 4):               $term_link = get_term_link( $term, 'genre1' );     if( is_wp_error( $term_link ) )         continue;     echo '
***<?php the_title();?>***
';      but i dont sure how.


Advanced theme training?

I've read a few books on building WP themes and I certainly understand the basics. I would like to know read up on advanced topics like hooks, wp_rewrite and how functions.php should be structured. Can anyone recommend any good resources?


My Category is too big on the Menu what can i do?

Currently I have a small amount of 100 categories and my MENU goes crazy big and I would like to be able to do 2 things if possible:   * First category menu with limited amount categories sorted by hits   * Second category menu with limited amount of categories choose by myself Is there any simple way to acomplish this either manually editing part of the code but yet allowing me to render the category by the wordpress code instead of having to type each by hand or a plugin with already such features ? PS: I was trying to use the search for this but even using "Category Menu too big" there were so many unrelated answer that it was hard to find anything good to my case.


When to load auto-login code?

I'm using this (simplified) code to automatically login users via a plugin for a single sign-on system:               $user_info = get_userdatabylogin( $username );     $user_id = $user_info->ID;     wp_set_current_user( $user_id );     wp_set_auth_cookie( $user_id );     do_action( 'wp_login', $username );      Many code snippets that I've found online will bind this code to the `init` action. When using `init`, I'm having some trouble with the timing of elements loading on the page. For example, the user toolbar only appears on the second page load while the `Log In` meta link changes to `Logout` on the first. It seems that some elements are loading before the user session is setup. When should I load this code? Looking at http://codex.wordpress.org/Plugin_API/Action_Reference, is plugins_loaded the best time? Thanks, Mike


How to include external page to wordpress page?

I have one external page (`google_map.php`) which contain code to display google map information based on the selection criteria. And in the wordpress page I want to display the google map which is coded in `google_map.php`. I want to ask that how can I add `google_map.php` page in my wordpress page? Or other option, Can i directly add my `google_map.php` page code to the wordpress page? I don't want to use any plugin to support php code in the wordpress page like Exec-PHP plugin. Which is the better way?


How do I programmatically create new posts of a custom post type over the XML-RPC API?

I would like to programmatically create posts of a custom post type with custom taxonomies over the XML-RPC API. This is what I have so far:               <?php          class XMLRPClientWordPress {              var $XMLRPCURL = "";         var $UserName = "";         var $PassWord = "";              // constructor         public function __construct($xmlrpcurl, $username, $password) {             $this->XMLRPCURL = $xmlrpcurl;             $this->UserName = $username;             $this->PassWord = $password;         }              function send_request($requestname, $params) {             $request = xmlrpc_encode_request($requestname, $params);             $ch = curl_init();             curl_setopt($ch, CURLOPT_POSTFIELDS, $request);             curl_setopt($ch, CURLOPT_URL, $this->XMLRPCURL);             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);             curl_setopt($ch, CURLOPT_TIMEOUT, 1);             $results = curl_exec($ch);             curl_close($ch);             return $results;         }         function create_post($title, $body, $category, $keywords = '', $encoding = 'UTF-8') {             $title = htmlentities($title, ENT_NOQUOTES, $encoding);             $keywords = htmlentities($keywords, ENT_NOQUOTES, $encoding);             $content = array(                 'title' => $title,                 'description' => $body,                 'mt_allow_comments' => 0, // 1 to allow comments                 'mt_allow_pings' => 0, // 1 to allow trackbacks                 'post_type' => 'post',                 'mt_keywords' => $keywords,                 'categories' => array($category)             );             $params = array(0, $this->UserName, $this->PassWord, $content, true);                  return $this->send_request('metaWeblog.newPost', $params);         }          }          $objXMLRPClientWordPress = new XMLRPClientWordPress("localhost/wordpress/xmlrpc.php", "admin", "abbas");          echo '
';     echo 'metaWeblog.newPost	';     echo '' . $objXMLRPClientWordPress->create_post('Hello WordPress XML-RPC', 'This is the content of post done via XML-RPC', '') . '	';     echo '
';     ?>


Broken thumbnails (sometimes) with TimThumb

Reinstalled theme with latest version of TimThumb (was previously effected by the vulnerability issue). Now most of my thumbnails work, but some do not. My theme relies on this plugin, so I'm not sure I have any other option but to use TimThumb, but this is pretty frustrating. The worse thing is that the bug is only effecting certain photos of mine but not the rest. Clicking on the broken thumbnail directs to the full size image, so the image itself is good, but no matter what I do, that thumbnail won't generate. I've tried renaming the files, re-exporting from the master .psd file to a jpg with a different name, changing the total size of the image, even changing the color space, and nothing can convince this plugin to create a thumbnail for certain of my photos. What the hell is going on? Any insight is appreciated. www.redtownphoto.com Checkout "Test" in my menu to see what I'm referring to. Thanks in advance for any help. I could sure use it. _update_ 2 complete galleries have now died on me suddenly and thumbnails are completely broken. It looks like this issue is worse than I thought.


Wordpress Landing Page Redirection Issue

This might be a basic issue but I did not know the keywords to search it with. I am working on a Wordpress site. The landing page has the following url: `http://www.abc.com/home/` But when I visit this url, the page is redirected to: `http://www.abc.com/` Although the template that loads on the url `http://www.abc.com/`, is the same which has to be loaded on the url `http://www.abc.com/home/`, but for some reasons I really want the `"/home/"` part. The url works fine for other pages. That is if I visit "Contact" page, correct url is loaded in the address bar "`http://www.abc.com/contact/`" This is the .htaccess file that I currently have:               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress


Displaying an image's alt title and caption inside a fancybox window. Working, but showing the same alt and caption for each image

I've been at this for hours so maybe someone here can help :) Basically I have a fancybox gallery that loads images attached to a post. As you can see below, I want to echo either the image's caption or alt title into the fancybox window. Currently it works, but it only shows the alt and caption for **one** of the images, which looks to be the first. I can echo the alt title and caption of each image onto the page fine, but when it's used inside the fancybox window there's an issue. Anyone know why? Do I need to do some more looping or something? thanks for looking!


Wanted: PayPal plugin for Wordpress

i am currently searching for a wordpress plugin to integrate a paypal purchasing form conveniently to a blog. The goal is to have an order form where users have the option to either decide to order a product home or to purchase the product in digital and receive a tokenized downloadlink - of course after purchase approval from paypal. does anyone know a plugin for wordpress that does this job? many thanks!


Different rss feeds in a single dashboard widget

I am using this snip of code to get rss feed on my dashboard as widget. It becomes problematic when it displays 5-6 different rss feeds which makes me run down deep. How can I add 6 different feeds in a single dashboard widget with scroll bar? Thanks                   add_action('wp_dashboard_setup', 'my_dashboard_widgets');     function my_dashboard_widgets() {          global $wp_meta_boxes;          // remove unnecessary widgets          // var_dump( $wp_meta_boxes['dashboard'] ); // use to get all the widget IDs          unset(               $wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'],               $wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary'],               $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']          );          // add a custom dashboard widget          wp_add_dashboard_widget( 'dashboard_custom_feed', 'Latest News', 'dashboard_custom_feed_output' ); //add new RSS feed output     }     function dashboard_custom_feed_output() {          echo '
';          wp_widget_rss_output(array(               'url' => 'http://www.nytimes.com/feed',  //put your feed URL here               'items' => 4, //how many posts to show               'show_summary' => 1          ));          echo "
";     }


Pointing multiple subdomains at the same WordPress Installation

We have some branded subdomains for clients in our application. so client.ourdomain.com gets some minor customization to the look and feel. We are now creating some marketing pages and implementing WordPress as a CMS but we want to be able to keep the branding per subdomain. Basically we want client1.ourdomain.com to point to the same installation as www.ourdomain.com but the menus at least need to point to client1.ourdomain.com. The same would be true for client2.ourdomain.com, etc. The list of branded subdomains is a fixed list and approximately 20.


Call to undefined function add_action()

I created a Theme Options page where the user can edit some of the theme settings. Now I'm trying to save this options asynchronously but it seems I have some problems integrating the handler file into WP. The Theme Options is a simple admin page nested under Appearance. When pressing the save button:               <a id = "save-settings" href = "#" data-nonce = "<?php wp_create_nonce("sace_settings_nonce") ?>"><?php echo _('Save Settings') ?>      the following JS script is called:               function(){         jQuery.ajax({             type : 'POST',             url : themeRoot + 'framework/AsyncAction.php',             data: { action  : 'save_settings',                     name    : 'John',}             }).done(function(resp) {                 alert(resp);             });     },      The handler `.php` file contains:               <?php     include_once('SettingsController.php');     define ('SAVE_SETTINGS', 'save_settings');          add_action('wp_ajax_save_settings', 'save_settings');          function save_settings(){         global $controller;         $name = esc_attr($_POST['name']);         echo 'Hi, ' . $name;     }          ?>      Running this code throws the following error:               Fatal error: Call to undefined function add_action()      I also tryied:   1. hook the action on init -> same problem   2. remove the hook completely. This caused the undefined error to be thrown for `esc_attr()` It seems that I don't have access to any of the WP functions but I have no idea how to fix it. Thanks!


get_posts includes "auto drafts"?

I'm using get_posts to generate a list of posts.               $args = array(         'post_type'     => 'post',         'numberposts'       => -1,         'post_status'       => array('publish'),         'orderby'       => 'post_date',         'order'         => 'DESC',         'suppress_filters'  => false     );          $posts = get_posts( $args );      However, the list includes posts named _"Auto-Draft"_ , even though I do not include them in the `'post_status'` parameter. As far as I read those Auto- Drafts should be only existing for 7 days, but the posts that show up in the list are far older than 7 days. Anything I'm missing? Thanks!


Different Slugs depending on last page

is it possible to configure WordPress on some way that if i have a portfolio Item ( from my theme ) which will be opened from 2 different pages and w/o an URL jump so that www.xyz.com/brands/example and www.xyz.com/brands/ourbrands/example woud redrict to the same portfolio item, the current solution is that both woud redrict to www.xyz.com/portfolio/example, ofc i can change the "portfolio" slug to sth. different but that woudnt solve the problem since the URL woud still jump :/ Custom Post types is NOT an option. Hopefully someone can help me here :D Thanks in advance Manuel


Where's The Best Place to use Register_Shutdown_Function()?

I want to use Register Shutdown Function to track Fatal Errors, my question is, where's the best place to call this so it hits both WordPress, Plugin, and Theme Fatal Errors?


WP Rewrite Rules - insert custom rules

function rewriteRules() {             add_filter( 'rewrite_rules_array', array( $this, 'my_insert_rewrite_rules'));             add_filter( 'query_vars',array( $this, 'my_insert_query_vars'));             add_action( 'wp_loaded',array( $this, 'my_flush_rules'));         }         function my_flush_rules(){             $rules = get_option( 'rewrite_rules' );             if ( ! isset( $rules['curs-calificare-profesionala/(\s*)$-(\d*)$'] ) ) {                 global $wp_rewrite;                 $wp_rewrite->flush_rules();             }         }         function my_insert_rewrite_rules( $rules ) {             $newrules = array();             $newrules['curs-calificare-profesionala)/(\s*)$-(\d*)$'] = 'index.php?pagename=course&course=$matches[1]&cid=$matches[2]';             return $newrules + $rules;         }         function my_insert_query_vars( $vars ) {             array_push($vars, 'cid');             return $vars;         }              public static function courseDetailsUrl($name, $id ) {             $prefix = '/curs-calificare-profesionala/';             $url = $new_url = sanitize_title( $name );             $suffix = '-'.$id;             return $prefix . $url . $suffix;         }      what i want: http://domain.ro/curs-formare-profesioanal/curs-masaj-17 -> index.php?pagename=course&course=curs-masaj&cid=17. I can declare course.php in my theme for this URL? Please help!!!


Which hook if user profile information is updated?

I'm looking for the hook that fires when a user's information are updated. Specifically, I want to update a post with the value of a custom profile field (in my example `info`) everytime that user's profile is updated. I tried the `profile_update` hook, but it doesn't seem to fire:               add_action( 'profile_update', 'add_info_to_post' );     function add_info_to_post( $user_id ) {                  $info=get_user_meta($user_id,'info',true);                  //get all items of that user             $args=array(                     'author' => $user_id,                     'post_type' => 'item',             );                  $items=get_posts($args);                         foreach ($items as $item){             update_post_meta($item->ID,'user_info',$info);             }     }      Any suggestions how to make this work? EDIT: Maybe I should mention that I access the users' profile pages through the backend..


how can I create a calendar for a cpt, using get_calendar or other

I have a custom post type with its own date field. the date is setup for unix YYYY/mm/dd I need to create a simple month calendar that shows days that have a cpt on them. get_calendar works for posts but not a CPT.


How can I make my website with wordpress having on-spot editing feature as compared to concrete5 CMS?

I hope you were easily able to understand my situation through the question. 1.Do we have any theme or plugin for on-spot editing the post by people or by me after the blog post is posted? 2.If there isn't any theme or pluggin for such feature should I make plugin or theme independently for my website. 3.If both of the above fails,please give me a better option for some other kind of CMS as there are no many cms and I want to make my website with dynamic features. Please follow the link below and kindly suggest me one. http://en.wikipedia.org/wiki/List_of_content_management_systems