Skip Navigation

[Resolved] using a view in an archive

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

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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+01:00)

This topic contains 3 replies, has 2 voices.

Last updated by Nigel 3 years, 6 months ago.

Assisted by: Nigel.

Author
Posts
#1796345

In this toolset thread: https://toolset.com/forums/topic/sorting-table-columns/ the supporter said

"The best workaround to include sortable columns here is to remove all the Query Filters, filter controls, pagination controls, and loop contents from this WordPress Archive and construct a similar View of Air Filters with the sortable table headers, front-end filters, pagination, etc. you want to show in the archive."

I have tried to do that, but can't get it to work.
I have created this view: hidden link

I want to put it into this archive: hidden link

I deleted everything but this loop

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-view name="air-filters-view" cached="off"]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-layout-end]

but that seems to actually loop the view... not sure how to do what the supported requested

you will need to log in to see what I mean, TO DO SO CLICK HERE: hidden link

#1796501

Nigel
Supporter

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

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

Where you inserted the View shortcode is inside the loop tags of the archive, meaning it will be output for every result of the archive.

Even if you don't want the archive itself to output anything, it still queries posts and iterates over the results, you just don't want to output anything from that query, as you are displaying something else.

So it's not a bad idea to update the archive settings to, say, a limit of 1, so there it is not needlessly iterating over results it won't output, and then move the wpv-view shortcode outside of the loop, like so:

[wpv-layout-start]
[wpv-view name="air-filters-view" cached="off"]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-layout-end]
#1797075

thank you! i dont see where in the settings to limit it to 1, can you show me where that is?

#1797653

Nigel
Supporter

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

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

Actually, you are right, the option isn't there on archives (only Views), but what you could do instead is set the pagination to display only one result at a time, which would have the equivalent effect.

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