Skip Navigation

[Resolved] View creates a loop of the main loop

This support ticket is created 5 years, 7 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by amarildow 5 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#1286949
loop-error.png

I created a view that shows parent taxonomies. The loop contains the taxonomy link + description.

On the taxonomy page I created a parent view that shows the taxonomy + a child view that shows the posts that belong to that taxonomy.

But in both cases when I place the view inside my archive template it shows the loop 3 times.

See image.

The loop I wanted to create worked but I don't understand why the loop is showing 3 times underneath each other.

I expected to see:
My view normally with the regular loop.

Instead, I got:
The loop repeating itself 3 times with the same results.

#1287005

Hello,

I assume we are talking about a taxonomy archive page.

If it is, please follow our document to customize it with Views WordPress archive:
https://toolset.com/documentation/user-guides/creating-wordpress-custom-post-archives/

And you can display current taxonomy archive title with shortcodes: [wpv-archive-title]
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-archive-title

#1287345

Yes, it's a taxonomy archive page. I'm already displaying the archive title.

My issue is that it all works, but the wpv loop inside the view gets shown 3 times with the same results. As seen in the enclosed screenshot. For some reason it repeats itself.

#1287355

Had to place the parent view outside of the WPV loop and within a content template. Also wrapping the fields inside a content template caused them to not show up, so the loop created inside the parent view shouldn't be wrapped in a content template.