Skip Navigation

[Resolved] Taxonomy view is displaying empty terms

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

Problem:

The issue here is that the user wanted to display the taxonomy terms of the current post using a view.

Solution:

This can be done by using a nested view setup. I would recommend having a look at our documentation below on how to nest views.

https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/#taxonomy-view-within-taxonomy-view

Instead of using the Taxonomy Parent filter, you will use the Taxonomy Term filter.

This support ticket is created 5 years, 8 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.

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

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 10 replies, has 2 voices.

Last updated by angelapiqui 5 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#1279845
Parent-2.png
Parent.png
Child-2.png
Child.png

Hey guys, I would like to display taxonomy terms from current post, so I need that empty terms are not shown with the checked ones. To do that, I created a view to display taxonomies and left the following options checked: Don't show empty terms / Include terms that have non-empty descendants / Include children in the post count. The result was that all taxonomies were displayed, even the ones that were not checked in the current post.

I then read a few more documentation:
https://toolset.com/forums/topic/taxonomy-views-dont-show-empty-terms-not-quite-right/
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/
https://toolset.com/forums/topic/dont-show-empty-terms/

So I created nested views (one parent and one child - screenshot) as explained in the docs above, but again, it's not working. Instead, I got "no items found" message. I'm not quite sure if I've understood exactly how I should do this.

Could you have a look on my site and tell me what I'm doing wrong? I would really appreciate it 🙂

#1279909

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Sintia,

Thank you for getting in touch.

You want to display the taxonomies of the current post, however empty taxonomy terms are showing up ?

Please let me know if this is the exact scenario.

Thanks,
Shane

#1279929

Hi Shane,

Thank you for writting back!

Yes, exactly. I want to display the taxonomies of the current post, but empty taxonomy terms are showing up. I'm sorry if I wasn't too clear. Let me know if you need any other information. 🙂

#1281033

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Sintia,

I understand what you are trying now.

Could you show me the page where these views are added to the frontend.

I'm assuming you want to do a setup where you List the Parent terms and the child terms under each parent correct?

Please let me know.
Thanks,
Shane

#1281143

Hi Shane, thanks for replying.

I'm sorry, as you might have noticed I'm not an IT person, my knowledge is basic. I'm not sure if I understand what it would be parent and child terms in taxonomies.

This is what I did:
1. I just created a taxonomy called "boat features" > then created the terms inside it > and checked the terms inside each post (under post type: "Boats"). Each post has a few taxonomies (not all of them) checked. What I want to do is to show the taxonomies that are assigned to the current post displayed on the front-end. I don't want it to display all terms, as I've had to create a lot of them.

2. Created 2 views: one parent and one child (which should be within the parent view). Label of the views: "Equipment parent" and "equipment child".

3. To display those posts in the front-end, I created a template in Elementor and placed a "Toolset View" Element inside the template. This template is supposed to display the taxonomies assigned to the current post. The template was created in "Elementor Templates" >theme builder >name of the template: "Template Barcos Resultados Busca" (sorry, it's Portuguese - it's the third template in the list). The View Element is placed at the bottom of the page - last element.

This is the URL to see the page: hidden link

I hope this helps 🙂

Best Regards,

#1281207

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Sintia,

Could you give me an example of how you want your items to be displayed?

Is it.

Taxonomy A
- Post A
- Post B
- Post C

or

Taxonomy B
- Taxonomy child A
Taxonomy C
- Taxonomy child C

Please let me know.
Thanks,
Shane

#1281271
Taxonomies-post-1-.jpg

Hi Shane,

I made an illustration so you can see what I need to do. Please see the attachment.

#1281287

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Sintia,

Great thank you for the example.

This should now be working. I've modified the query filter for this view here hidden link

This should now only be listing the taxonomies that are checked on the current post.

Thanks,
Shane

#1281309

That's great! Thank you for that.

So, I have to set the query filter as "Taxonomy is set by the current post", right?
Another thing is that I noticed that you changed to the child view in the "Toolset view" widget in the Elementor template. Just to confirm, so it's the child, not the parent that I have to use in the case, is it?

#1281945

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Sintia,

Yes I change it to "Taxonomy is set by the current post". Also yes I switched it to the child view. In your case you don't need a Parent or a child view.

You only need a taxonomy view with the filter set to "Taxonomy is set by the current post".

Thanks,
Shane

#1282105

My issue is resolved now. Thank you!