WordPress query with items from more than one selfdefined taxonomy as `term` argument

I managed to do it. I used the following query parameter: ‘tax_query’ => array( array(‘taxonomy’ => ‘wpccategories’, ‘field’ => ‘slug’, ‘terms’ => $termz ) ) With $termz being: $termz = wp_get_object_terms($id, ‘wpccategories’, array(“fields” => “slugs”)); The problem I struggled with was that I needed to use singular ‘field’with singular ‘slug’ in the tax_query (I knew … Read more

Display Authors in a grid loop

Definitely over thinking it <div class=”section group”> <?php printf(‘<h1>%s</h1>’, the_title()); foreach($users as $user) { ?> <div class=”author”> <div class=”col span_1_of_3″> <div class=”authorAvatar”> <?php echo get_avatar( $user->user_email, ‘128’ ); ?> </div> <div class=”authorInfo”> <h2 class=”authorName”><?php echo $user->display_name; ?></h2> </div> </div> </div> <?php } ?> </div>

Post Loop Missing Most Recent Post

If you don’t specify posts_per_page in your get_posts you will get the default amount of posts, which is five. Normally the offset is 0 and order is by date, so this doesn’t explain why the most recent post would be missing.

Counter in loop in foreach

EDIT Ok so after better understanding your issue, I would not use a counter but a true/false flag that we switch when it’s been used. Try this code. $cats = array(‘batiments-delevage’, ‘logements-bovin’, ‘stockages-deffluents’, ‘soins-et-hygiene’); $exclude_posts = array(); $active = true; foreach( $cats as $cat ) : // build query argument $query_args = array( ‘category_name’ => … Read more