Navigation überspringen

[Gelöst] Search posts by multiple checkboxes field value

This support ticket is created vor 1 Jahr, 11 Monaten. 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.

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von poM vor 1 Jahr, 11 Monaten.

Assistiert von: Christopher Amirian.

Author
Artikel
#2542095

poM

Hi,

I have a custom post (region) with a multiple checkboxes field (departements).

I need to find region posts by a given department value with PHP and WP_Query.

How can I do that ?

Chhers

#2543643

Christopher Amirian
Supporter

Sprachen: Englisch (English )

Hi there,

You can check the WP_Query details on how to do so:

https://developer.wordpress.org/reference/classes/wp_query/

Toolset uses the standard WordPress functions to add custom fields and custom post types. The only thing that you need to do is to add the slug of the custom field using the prefix so for you: wpcf_ departments

Thanks.

#2544073

poM

Hi,

I finally worked it out with custom views.

This is to complex to query fields wi the serialized values.

Cheers