Skip Navigation

[Resolved] Two custom fields in one dropdown filter at the same time

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wants to combine 2 separate custom fields into one filter for a search.

Solution:
Unfortunately no you won't be able combine 2 different custom fields into 1 for a search as they will need to be queried as separate meta queries in the database.

Because of this if the fields are combined as one filter then you won't be able to do it.

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 2 replies, has 2 voices.

Last updated by katjaS-3 3 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#1998245

Hi,
For a custom post type (books) I have two custom fields the book authors firstname and lastname.

For a view I have to set a filter as a drop down that is containing the lastnames only. But I would like to show "lastname, firstname". Any idea how to realize this?

URS
Frank

#1998347

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Frank,

Thank you for getting in touch.

Unfortunately no you won't be able combine 2 different custom fields into 1 for a search as they will need to be queried as separate meta queries in the database.

Because of this if the fields are combined as one filter then you won't be able to do it.

Please let me know if this clarifies the issue for you.

Thanks,
Shane

#2000565

My issue is resolved now. Thank you!