Answers for "wordpress wp_get_post_terms"

PHP
7

wordpress get taxonomy of a post

//Get all terms (names) of a taxonomy of a post
$term_obj_list = get_the_terms( $post->ID, 'taxonomy_name' ); ?>
Posted by: Guest on July-09-2020
3

wp_query post by category id

$args=array(
    'posts_per_page' => 50, 
    'post_type' => 'my_custom_type'
    'cat' => $cat_id,
);
$wp_query = new WP_Query( $args );
Posted by: Guest on June-20-2021
1

get category post in wordpress

echo '<p>'. get_the_category( $id )[0]->name .'</p>';
Posted by: Guest on October-18-2021

Browse Popular Code Answers by Language