Skip Navigation

[Resolved] Custom taxonomy archive displays everything three or four times

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

Problem:
When I createa View and Query Filter this View by:

Select posts with taxonomy: Conditions the same as the current archive page

and then insert this View in a Archive View Loop, everything gets displayed repeatedly.

Solution:
This is expected, since you insert a Loop (list of things) into antoher Loop (list of other things)

What you should do is put the first view just before the tag, in the Archive View, so it wont be repeated for each item found in the Archive View.

This support ticket is created 7 years, 9 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 2 replies, has 2 voices.

Last updated by Sarah Burridge 7 years, 8 months ago.

Assisted by: Beda.

Author
Posts
#419129
Views setup.jpg
Output.jpg
Archive setup.jpg

This is my first time trying to do some of the more complex things in views. I am building a site for an acupuncturist, and have created a custom taxonomy called "Conditions". I am using this taxonomy to label pages and testimonials (which I have created as a custom post type) with the type of medical condition they treat, e.g. "acid reflux".

My hope is to be able to create archive pages for individual conditions such as acid-reflux that will pull together all page content and testimonials that are labeled with the condition name. I would like these pages to display the page content at the top, then the testimonial content at the bottom.

So far, I have basically achieved this by:

1. Setting up two Views - one each for Pages and Testimonials. I have set them with the following query filter: "Select posts with taxonomy: Conditions the same as the current archive page"

2. Then I created a WordPress Archive for the "Conditions" taxonomy. In the loop output editor, I have inserted my Page view and Testimonial view from step one.

It is working, in that is successfully pulls this content together. HOWEVER, the output on the archive page repeats three+ times.

What am I doing wrong???

#419250

The View, post as well as Archive View, has the Loop.
This loop will run as many times as there are items found.

So your Content IN the Loop, will be output as many times as there are items found.

Most certainly you have 3 Items in the taxonomy and that runs the Views you inserted to the Archive ... 3 times.
Therefore triplicated output.

What you can do is to insert those 2 Views in the WordPress Archive OUTSIDE the Loop Tags but INSIDE the wpv-items-found shortcode.

Does that work?

#419439

AH. Got it. Okay, I am getting how this works. Thank you!

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