Answers for "wordpress get data from post type and taxonomy id"

0

wordpress get data from post type and taxonomy id

$posts_array = get_posts(
    array(
        'posts_per_page' => -1,
        'post_type' => 'fabric_building',
        'tax_query' => array(
            array(
                'taxonomy' => 'fabric_building_types',
                'field' => 'term_id',
                'terms' => $cat->term_id,
            )
        )
    )
);

foreach ($posts_array as $post) {
	print_r($post);
	echo $post->ID;
}
Posted by: Guest on June-18-2021

Code answers related to "wordpress get data from post type and taxonomy id"

Browse Popular Code Answers by Language