Title: Dynamic Term ID shortcode
Last modified: November 17, 2021

---

# Dynamic Term ID shortcode

 *  Resolved [GetWebCreative](https://wordpress.org/support/users/getwebcreative/)
 * (@getwebcreative)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/dynamic-term-id-shortcode/)
 * On my custom post template I want to show the image assigned to the category.
 * There are many categories so I don’t want to create a new template for each one.
 * Can I dynamically get the term ID to populate the Post ID field?
 * I created a shortcode to return it along with the prefix (eg. course_category_31)
   but this doesn’t work in the Post ID field (I knew it was a long shot but worth
   a try!).
 * Any idea how to make this happen?
 * Works great when I enter ‘course_category_31’ manually.

Viewing 1 replies (of 1 total)

 *  Thread Starter [GetWebCreative](https://wordpress.org/support/users/getwebcreative/)
 * (@getwebcreative)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/dynamic-term-id-shortcode/#post-15075510)
 * Scratch that!
 * I created a shortcode to retrieve the hero image url directly and changed my 
   source from ‘Media Library’ to ‘URL’. Works great. 🙂

Viewing 1 replies (of 1 total)

The topic ‘Dynamic Term ID shortcode’ is closed to new replies.

 * ![](https://ps.w.org/easy-acf-connect-for-themer/assets/icon-256x256.jpg?rev=
   1936430)
 * [Easy ACF Connect For Themer](https://wordpress.org/plugins/easy-acf-connect-for-themer/)
 * [Support Threads](https://wordpress.org/support/plugin/easy-acf-connect-for-themer/)
 * [Active Topics](https://wordpress.org/support/plugin/easy-acf-connect-for-themer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/easy-acf-connect-for-themer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/easy-acf-connect-for-themer/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [GetWebCreative](https://wordpress.org/support/users/getwebcreative/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/dynamic-term-id-shortcode/#post-15075510)
 * Status: resolved