How can i display the posts per week in a particular month?

You’ll need to add a condition to the posts_where filter in wordpress. I have an example here for only pulling posts that are from the current post’s date and earlier: Add this to functions.php // filter wp_query when $dated_before is set function dg_dated_before($where) { global $wp_query, $wpdb, $dated_before; if (isset($dated_before)): $where = $where . ” … Read more

query_posts() ALWAYS displays something?

query_posts() ALWAYS displays something? No it doesn’t at least not for me, i’ve tried the code you posted inside my child theme and was unable to reproduce the issue described. Firstly, i tried… while ( have_posts() ) : the_post(); ?> <!— DO NOTHING ! –> <?php endwhile ?> ..and got nothing, so i then tested.. … Read more

tax_query operator woes

I’m not sure that there is a way to get it to use ‘OR’ instead of ‘AND’. Alternatively, you can do: $myquery[‘tax_query’] = array( ‘relation’ => ‘OR’, array( ‘taxonomy’ => ‘regions’, ‘terms’ => array(‘region1’), ‘field’ => ‘slug’, ‘operator’ => ‘IN’ ), array( ‘taxonomy’ => ‘population’, ‘terms’ => array(‘pop1’), ‘field’ => ‘slug’, ‘operator’ => ‘IN’ ), … Read more

WordPress query_posts and orderby page order

I was going to suggest using &orderby=menu_order, but you already pointed it out in your comment. 🙂 p.s. you can answer your own question, I think. Since you found the answer to your question, just post your own answer. I think it”s kosher to accept your own answer?

WordPress pagination showing same posts on each page

You can replace the code with something like this <?php global $wp_query; $limit = get_option(‘posts_per_page’); $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; query_posts(array(‘posts_per_page’=>$limit,’paged’=>$paged,’category_name’=>’albertsons, carrs, dominicks, genuardis, heb, kroger, pavillions, publix, randalls,safeway,shop-rite,tom-thumb,vons,whole-foods’)); /* you may want to uncomment the below two lines if you are using custom page template*/ //$wp_query->is_archive = true; //$wp_query->is_home = false; then … Read more

Tricky WP Query

For that kind of complex query, I’d recommend running two queries and then merging the results. First, get an array for: get all posts WHERE ( post_type=”post” AND category = 7 ) Then, get an array for: ( post_type=”case-studies” AND meta_key = ‘homeslide’ AND meta_value = 1 ) Then use array_merge() to combine the arrays … Read more