Skip Navigation

[Resolved] multiple CPT views – exclude already present posts

This support ticket is created 6 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
- 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+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by jozsefG 6 years, 6 months ago.

Assisted by: Nigel.

Author
Posts
#644051

Hello

I hav a grid view of a CPT with random posts, and I need to make a list view of the same CPT lower on the same page. I don't want those posts already in the grid to show up in the list too. How can I set up the query?

Another possible proble. I'll have 4 views on the same page which means 4 queries. Isn't the server load too much with 4 queries? There are tens of post not thounsands.

#644350

Nigel
Supporter

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

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

Hi Jozsef

If this is not a particularly large site you should be fine with several queries on the same page.

If you have one View which displays "projects" that are marked as "featured" (e.g. you are using a taxonomy or custom field for this), and then lower down the page you want to display the other projects that are not featured, then you would add the opposite filter to that in your original View.

In the Query Filter section when you insert a filter, by default the comparison would be "is equal to", but for the second View you might use "is different from" the same value, for example.

#644351

In case of the other cot I do this. But in case of the activities cpt I cannot have featured posts. And I show random posts. If I cannot exclude already present posts I'll have to show the last ones in the grid and I the list make a query with offset.

#646975

Nigel
Supporter

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

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

Hi Jozsef

If your first View shows random posts there is no way for the second View to know which posts were randomly chosen for the first to exclude them, and so some duplication may be inevitable.

#670671