Skip Navigation

[Resolved] unique content inside archive loop

This support ticket is created 3 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.

This topic contains 5 replies, has 2 voices.

Last updated by Christopher Amirian 3 years, 8 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2368007

I need to set up an archive page so that specific content is displayed:

One after the first post, and second to be displayed after every 4 posts in the loop. Is this possible?

#2368717

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

It is possible with the legacy views. You need to enable it:
- Go to "Toolset > Settings > General".
- Find the "Editing experience" section.
- Check the "Show both the legacy and Blocks interface and let me choose which to use for each item I build" checkbox.
- Reload the browser page.
- Go to the newly added "Toolset > Views" menu.
- There you will be able to edit the views.

For more information:
https://toolset.com/course-lesson/enabling-legacy-version-of-toolset-views/

After that create a view using the loop editor:
https://toolset.com/documentation/legacy-features/views-plugin/front-page-filters/

Now inside the view you can use the wpv-item shortcode to determine the index of the loop where you can insert additional information:

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-item

Here is an example:

https://toolset.com/forums/topic/how-to-insert-an-advert-every-x-results-in-view-loop/#post-1147801

Thank you.

#2369171

Thank you Chris, it help me a lot. I use this code, bud I need to show in loop only 9 items and then pagination and link to next (or prew) page with search results, what I do wrong?

[wpv-layout-start]
[wpv-items-found]

<!-- wpv-loop-start -->
<div style="padding: 15px;">

<wpv-loop wrap="9" pad="true">

[wpv-item index=1]
<h2 style="padding: 10px; background: #F5F5F5; margin-bottom: 15px;">[wpv-post-link]</h2>
<p>my ad code</p>
[wpv-item index=other]
<h2 style="padding: 10px; background: #D3D3D3; margin-bottom: 15px;">[wpv-post-link]</h2>
[wpv-item index=5]
<h2 style="padding: 10px; background: #D3D3D3; margin-bottom: 15px;">[wpv-post-link]</h2>
<p>my ad code</p>
[wpv-item index=other]
<h2 style="padding: 10px; background: #D3D3D3; margin-bottom: 15px;">[wpv-post-link]</h2>
[wpv-item index=9]
<h2 style="padding: 10px; background: #D3D3D3; margin-bottom: 15px;">[wpv-post-link]</h2>
<p>my ad code</p>
</wpv-loop>
</div>
<!-- wpv-loop-end -->

[/wpv-items-found]

[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

#2369465

Christopher Amirian
Supporter

Languages: English (English )

Screen Shot 2022-05-23 at 19.24.17.png

Hi there,

I am not sure what is the issue with your code.

What IU see is that for pagination you need to use the pagination shortcode:

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-153234

And for the search box:

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-155460

I suggest that you learn more about the shortcodes here:

https://toolset.com/documentation/programmer-reference/views/views-shortcodes

Also, you can use the Pagination Controls button in the loop editor to add the pagination shortcodes. (Check the screenshot)

Thank you.

#2369485

Great, you save my day, I switch off pagination:-)

#2369831

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

Glad that it helped 🙂