Display Custom Post Type Based on Taxonomy With WP_Query()


I would like to pull in 3 posts from a custom post type called ‘articles’ that have a ‘featured’ taxonomy.

I’m using the code below, but it isn’t pulling in just the posts with the ‘Featured’ taxonomy, and I can’t seem to get it work. The ‘Featured’ taxonomy is an additional taxonomy used with other taxonomies for this post type, but I wouldn’t think that would prevent the WP_Query() pulling in the ‘Featured’ taxonomy?

Any suggestions would be really welcome.

    $homePageFeatured = new WP_Query(array(
        'posts_per_page' => 3,
        'post_type'=> 'articles',
        'tax_query' => array(
                'taxonomy' => 'Featured',

    while(  $homePageFeatured->have_posts()){
            $homePageFeatured->the_post(); ?>

                <!-- HTML FOR TAXONOMY  -->

<?php } ?>
<?php  wp_reset_postdata(); ?>
, , The Chewy 4 years 2020-05-17T23:10:44-05:00 0 Answers 101 views 0

Leave an answer