Skip Navigation

[Closed] On page load show all results from only 1 CPT used by the Search Form

This support ticket is created 4 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 4 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#1655715

Tell us what you are trying to do?

I have a search form on my site that has 2 CPTs for Content Selection. When the page is first loaded, before any entries are made into the search form, it displays all entries from both CPTs. I would like the default on page load to show all entries from just one CPT.

Is there any documentation that you are following? No

Is there a similar example that we can see?
hidden link The Domaine and Label searches on this page.

What is the link to your site?
hidden link

#1656001

Hello, there's nothing exactly like this you can achieve in wp-admin, but with a small amount of custom code using our filter wpv_filter_query you can probably accomplish something similar:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query

I can help you implement this code if you can tell me a bit more:
- What is the numeric ID of the View? You can find this in the Views dashboard (Toolset > Views) next to the View name.
- What is the slug of the post type you would like to display when no other filters are applied? You can find this by editing the custom post type in wp-admin.
- Are any Query Filters in this View predefined? For example, maybe you have a custom field called "status" and you only want to show those posts where the status field is "active". If this is the case, please edit this View, open the Query Filter panels and take screenshot(s) showing all the relevant configurations. If you cannot see the Query Filter panel, scroll to the top right corner of the editor page and click "Screen Options." You can turn on the panel here.

The topic ‘[Closed] On page load show all results from only 1 CPT used by the Search Form’ is closed to new replies.