Skip Navigation

[Résolu] Unable to display custom taxonomy terms in Views or Content Templates

This support ticket is created Il y a 6 années et 10 mois. 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)

Auteur
Publications
#521293

I've created a custom taxonomy with Types and have added custom terms, but I'm unable to see how I can add the values to a View or Content Template.

I don't see my term field group when clicking Fields and Views in the Loop Output Editor as described at: https://toolset.com/documentation/user-guides/displaying-wordpress-term-fields/
I did try to enter the shortcode manually as:

[types termmeta="provider-address"][/types]

but this doesn't return anything.

Has something changed since the documentation was written? I've got the latest versions of Types (2.2.9) and Views (2.3.1).

I can however output the term meta via the API using:

<?php echo types_render_termmeta( "provider-address", array( "term_id" => "4" ) ); ?>

But this is not ideal as I would like to keep it within the View and Content Template.

#521350

Minesh
Supporter

Languages: Anglais (English )

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

Hello. Thank you for contacting the Toolset support.

This is strange. I would like to check your settings. Where are you adding term fields? Could you please share edit view screenshot of your view?

Please note that:

At the moment, you can display term fields on a <strong> Views </strong> listing terms and on a term archive page.
#521402

Hi Minesh,

Thanks for looking into this.

I've created an example View with the shortcode here: hidden link

The Fields and Views window is here: hidden link and here: hidden link

The Terms are here: hidden link

The Term Field Control is shown here: hidden link

#521439

Minesh
Supporter

Languages: Anglais (English )

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

The thing is that you cannot access the term fields from views set to display custom posts. You can display the Term fields directly for taxonomy views.

You need to create a taxonomy view and filter your taxonomy view by "Taxonomy term filter" and within the loop output of your taxonomy view, you should add term meta shortcodes. And then add the taxonomy view to your post view.

#521566

Thanks, I think that makes sense from an implementation perspective. Do you have any example code you can share?

#521570

Minesh
Supporter

Languages: Anglais (English )

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

- Try to create another view and set content selection = Taxonomy and select your taxonomy
- Navigate to query filter and add taxonomy term filter:

Taxonomy term filter
Taxonomy is set by the current post

- Now, within loop output of your taxonomy view - add taxonomy term shortcodes you desire and save your view
- Then - go to your post view and add taxonomy view within the loop output section of your post view and save your view.

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

#521580

Hi Minesh,

I've followed those steps and (with a slight change to the filtering - as I wouldn't be able to specify which term will be applied) it's working now as required.

Thanks again.

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