Bootstrap grid while loop

Your while loop means, “Every time I have one post, output the following code.” Since you have 5 divs inside the while loop, you are getting 5 copies for each post. So, change your while { } code to this, which will output just 1 div for every post: while($blogposts->have_posts()) { $blogposts->the_post(); ?> <div class=”col-md-6″> … Read more

How can I write a WP_Query that is this specific?

The tax_query attribute is what you need. You could use it like so: $query_args = array( ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => array( ‘slug-of-category-a’ ), ), array( ‘relation’ => ‘OR’, array( ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => array( ‘slug-of-category-b’ ), ), array( ‘taxonomy’ => … Read more

WordPress Query by Category using Post Slug

function namefunctions(){ $args = array( ‘post_type’ => ‘CPT’, ‘posts_per_page’ => -1, ); $recetax = new wp_query($args); while ( $recetax->have_posts()): $recetax->the_post(); ?> /* your content of ctp*/ <?php endwhile; wp_reset_query(); }