Skip Navigation

[Resolved] How to display custom taxonomy directly in PHP file?

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to use views taxonomy shortcode with PHP template files.

Solution:
You can use do_shortcode() function to display taxonoly using views taxonomy shortcode.

You can find proposed solution with the following reply:
https://toolset.com/forums/topic/how-to-display-custom-taxonomy-directly-in-php-file/#post-409140

Relevant Documentation:
https://toolset.com/documentation/views-shortcodes/#wpv-post-taxonomy

This support ticket is created 8 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by marcellinoB 8 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#409032

I am trying to: display custom taxonomy in a php file

I visited this URL: n/a

I expected to see: /n/a

Instead, I got: n/a

I have created a custom taxonomy that i want to display directly in a custom search page that is using the query loop to display specific posts. In the loop i want to add my custom taxonomy.

Shortcode for it is

[wpv-post-taxonomy type='product-groep' format='name']

How would i display this using php code to get it displayed in my search page?

Thanks
Marcellino

#409140

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Could you please try following code:

echo do_shortcode('[wpv-post-taxonomy type='product-groep' format='name']');

You just need to wrap [wpv-post-taxonomy] under do_shortcode() function.

I hope above solution will help you to resolve your issue.

#410717

Minesh,

Works fine! Thanks!

I wasn't able to find this in docs on your website and/or didn't look right. True?

Marcellino

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.