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

  1. yuncreativelabs
    Posted 2 years 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 2 years 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)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress Picture / Portfolio / Media Gallery
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic