wp query – I’m trying to get posts under a custom taxonomy but I don’t know what I’m doing wrong here

Question

Im using the following php. and I’m only trying to call titles at the moment. I have 4 posts under this taxonomy.

    <?php 
            $shopPosts = array(
                'post_type' => array( 'shop' ),
                'posts_per_page' => -1,
                'tax_query' => array(
                            array(
                                'taxonomy' => 'textiles',
                                'field' => 'term_id',
                                'terms' => 32,
                            )
                        )
            );
            $shopPage = new WP_Query( $shopPosts ); ?>
            <?php while ( $shopPage->have_posts() ) : $shopPage->the_post(); ?>
<?php the_title(); ?>
<?php end_while; ?>

0
Philly 2 months 2023-03-19T20:48:58-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse