Archived topic
Shortcode to display taxonomy terms inside a post?
8 replies · Started by Miroslav on March 5, 2018
I'm using the Pods Framework (pods.io) and would like to display my custom taxonomy terms inside a post's content.
Unfortunately, their documentation is not great and my question in their support forum went unanswered.
Do you know how I could do that? Thanks!
Hi there,
Unfortunately I'm not familiar with that plugin.
I do see they are solving questions on their support forum though? https://wordpress.org/support/plugin/pods
Hi Leo,
Sure, I don't expect you to support other peoples' plugins. Just thought you might know the answer off the top of your head as Pods is rather popular and there are Pods related questions here on this forum.
Anyway, let me re-frame my question...
What's the best way to reference custom taxonomy terms from within my posts (i.e. not within the template file, but within the post/page content)?
Thanks!
I think the best way would be to create shortcodes. In your shortcodes you could add your PHP, which will call the custom fields.
Then you can use the shortcodes within your content to output them.
Thanks, Tom! I figured I need a shortcode (hence the title of this thread), but my understanding of PHP is only elementary.
Can you recommend a shortcode plugin that will execute PHP and work with WordPress tags? Basically, I need to call this in my post:
the_terms ( $post->ID, 'tool', '<ul><li>', '</li><li>', '</li></ul>' );
I found this plugin, which seems to be working well:
https://wordpress.org/plugins/insert-php-code-snippet/
Is there a better one you'd recommend?
That's probably the best one available :)
Great, thanks! Marking as resolved.
No problem! :)