Ready to get started?Download WordPress


WordPress Picture / Portfolio / Media Gallery
[resolved] Call Category of the post (2 posts)

  1. yuncreativelabs
    Posted 10 months ago #

    Hello guys,
    I'm no php expert and I was wondering if anybody here could help me figuring out a really simple line of code.
    In each one of my items page inside the Portfolio, I would like to dynamically show the category that post belongs to: any help?

    Thanks a lot!


  2. Nimble3
    Plugin Author

    Posted 10 months ago #

    $term_list = wp_get_post_terms($post_id, 'nimble-portfolio-type', array("fields" => "names"));

    $term_list now contains the array of all the categories (item types) attached to this post (make sure $post_id contains the correct post id)


You must log in to post.

About this Plugin

About this Topic