Skip Navigation

[Resolved] Creating a view to list taxomony terms

This support ticket is created 6 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 6 replies, has 2 voices.

Last updated by emilyT 6 years, 7 months ago.

Assisted by: Nigel.

Author
Posts
#629468

Hi folks

Apologies if I'm asking a question that's covered by your documentation. I feel like this is something I should be able to do but so far I'm failing!

I would like to create a view which lists all the taxonomy terms for a particular CPT. This is what I've done:
1. Created a view
2. Set it to Taxonomy for Content Selection
3. Added the taxonomy title and other details to the loop output

It is showing the details in the view, but because the active term has two items added to it it's actually listing it twice. I'm sure I'm doing something stupid!

Can you point me in the right direction please?
Cheers, Emily

#629493

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Emily

When people talk of taxonomy queries it is always a source of potential confusion.

You can query POSTS according to their assigned taxonomy terms.

Or you can query a taxonomy to display terms entirely independently of the posts to which they may or may not be assigned.

So you might create a View which queries a country taxonomy to list all the countries as links to their taxonomy archives (which would display the posts with that country assigned).

Now, you have created a View to display taxonomy terms. You have a few options which affect which terms are included (e.g. whether to include empty terms, i.e. not assigned to any posts), but the terms returned are otherwise independent of the connected posts.

The Loop Output section is going to iterate over those terms, so you can output the title of the term, or a link to its archive, etc.

You lost me at "but because the active term has two items added to it it's actually listing it twice".

Can you elaborate?

#629507

Hi Nigel

Thanks for your reply. I think this is what I'm trying to do:
"Or you can query a taxonomy to display terms entirely independently of the posts to which they may or may not be assigned."

So, a list of the taxonomy terms, linking to the taxonomy archive for that term.

So, this is what I've got so far:
- A view which is set to Content Selection: Taxonomy
- The Taxonomy selected
- No queries set
- Then in the loop I've created a list with the taxonomy title and link

This is what I'm getting: hidden link
Each term is showing several times, but it should just have Pico and Pendeen once. Which I'm sure is because I haven't set it up right!

Are you able to point me to a tutorial for setting a view to display the terms, or maybe talk me through it?

Cheers, Emily

#629537

Hi Nigel

The link I gave you in my previous message won't work now because of some changes I've made. This is the current link:
hidden link

Cheers, Emily

#629546

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Emily

What you describe sounds right, but clearly something is amiss.

Maybe the quickest thing would be if I could take a look at your View and check the data.

Let me mark your next reply as private. You may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site, though I don't intend to make any changes, I'll just be looking.

What is the View?

#629717

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Emily

Perhaps you can explain what you are trying to achieve.

The page you linked to is an archive, that displays Pebble Seat Clients POSTs.

In the loop output section of that archive—which will iterate over all such posts—you have inserted the View "Pebble Seat Product View" which displays the taxonomy terms of the Pebble Seat Products taxonomy.

Because you have inserted this View inside the loop output section of the archive it is repeated for every post in the archive.

Obviously not what you want, but, what do you want?

#629936

Hi Nigel

Ah, my problem is that I'd inserted it in the loop. I knew I was doing something stupid! I thought it was how I had created the view, but it's actually where I had inserted it that was causing the problem.

Thanks for pointing me in the right direction.

Cheers, Emily