Skip Navigation

[Résolu] limit CPT archive page

This support ticket is created Il y a 8 années. 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Marqué : 

This topic contains 1 réponse, has 2 voix.

Last updated by Beda Il y a 8 années.

Assisted by: Beda.

Auteur
Publications
#380444
Screen Shot 2016-04-05 at 11.00.01.png

For a custom post type, we have a date field. For the archive overview page of that CPT, we only want to list those records where the date is in the future.

How to limit the archive listing based on a specific field?

#380545

In a WordPress Archive, even created with Views, you can not manipulate the WP Query.
That is a native thing set by WordPress.

What you can do is use HTML Conditional and check on that DateField, comparing to a (custom created) TODAY Date and output results if you want.
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

If you want to use a Query, you need a Post View, and compare the Custom field to TODAY's date.
This is the simples approach and will require no Custom Coding.
https://toolset.com/documentation/user-guides/filtering-views-by-custom-fields/
https://toolset.com/documentation/user-guides/filtering-views-query-by-date/

You can still insert this View (post View) to the archive in question afterwards.

Thank you

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