Answers for "get posts from selected taxonomy"

1

get posts from selected taxonomy

$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,
            )
        )
    )
);
Posted by: Guest on January-06-2021

Code answers related to "get posts from selected taxonomy"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language