Stomping WP_Query in author archive to facilitate pagination with custom queries

t31os says: [See edit history for previous code and comments] Using Ajax to paginate your queries I’ve put together some code that will fetch your posts and comments via ajax using simple prev/next navigation via ajax. 1) Replace all the code you posted in your author.php with the following.. <?php $cat_settings = array( ‘Articles’ => … Read more

meta queries do ‘either/or’ checks

meta_query works on ‘both/and’ checks and also ‘either/or’.so don’t worry.your coding was correct.this is the actual format… $a = new WP_Query( array( ‘fields’ => ‘ids’, ‘ignore_sticky_posts’ => true, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘foo’, ‘value’ => array( ‘foobar’ ), ‘compare’ => ‘IN’ ), array( ‘key’ => ‘bar’, ‘value’ => array( ‘foobar2’ … Read more

difference between querying database and using the loop

There is no absolute better/worse/best/worst implementation. The correct implementation depends on what you’re trying to accomplish. For a great explanation, I direct you to this post by Digging Into WordPress, which explains the 4 basic means of interacting with the WordPress Loop: Default Loop So what makes it “default”? Mostly because it uses the default … Read more

How to querry for an item that saved in an array?

Jenny, first of all, I think you may be better off using Taxonomy Parameters in you queries. However, there are a couple of hackish ways to do what you want to some extent. $my_query = new WP_Query( ‘post_type=post&posts_per_page=-1’ ); $posts = $my_query->get_posts(); foreach ( $posts as &$post ) { // Get the details and unset … Read more