Answers for "get posts by term id"

PHP
0

wp get_posts return ids

get_posts(array(
    'fields'          => 'ids', // Only get post IDs
    'posts_per_page'  => -1
));
Posted by: Guest on August-02-2021
0

get term id by post id

INSIDE TAXONOMY PAGES
$term      = get_queried_object();
$term_id   = $term->term_id;
Posted by: Guest on January-02-2021

Browse Popular Code Answers by Language