Skip Navigation

[Resolved] Add filter to existing view that filters by custom post type

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

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 1 reply, has 2 voices.

Last updated by Nigel 7 years, 10 months ago.

Assisted by: Nigel.

Author
Posts
#406128

I am trying to: add another filter so that users can filter 3 custom post types by a specific post type (White Papers, Videos, Articles).

I already have this search View set up so that users can filter by two post taxonomies: "Gender" and "Topic". Each custom post type has a content template, this is applied using conditional logic in the "Results" portion of the view.

The client now wants to add another filter so that will allow users to select between White Papers, VIdeos and Articles (the three custom post types), as well as Topics, and Gender.

So the goal is to have these as three dropdown filtering options. Is this possible?

I visited this URL: hidden link

I expected to see:

Instead, I got:

#406140

Nigel
Supporter

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

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

Hi Heather

You can add multiple filters to your Views parametric searches, but not post type, that option doesn't exist.

I think you have two options.

One involves a certain amount of duplication. You can add a custom field to your content to say what type it is, i.e. your videos would have a custom field "type = video" etc. You can then add a query filter for the custom field to your parametric search view.

The other alternative would require some custom coding and may become pretty contrived, and would involve using the PHP filter wpv_filter_query to intercept the query to add an argument for the post type and which would require you to build the UI for the post type selector where your parametric search appears.

If you want to write some custom code your time would probably be better spent writing a small snippet to automatically set the custom field for content type described above automatically when creating a new White Paper, Video, or Article.

The forum ‘Types Community Support’ is closed to new topics and replies.

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