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?
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.
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]
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.
Great, you save my day, I switch off pagination:-)