Answer the question
In order to leave comments, you need to log in
How to search by custom fields in wordpress?
There is a filter that accepts 5 values. I pass them as a getom, these 5 values are in the product, in arbitrary fields.
$query = new WP_Query( array(
'post_type' => 'post',
'meta_query' => array(
array(
'key' => 'mood1',
'value' =>$_GET['value1'],
),
array(
'key' => 'mood2',
'value' => $_GET['value2'],
),
array(
'key' => 'mood3',
'value' => $_GET['value3'],
),
array(
'key' => 'mood4',
'value' => $_GET['value4'],
),
array(
'key' => 'mood5',
'value' => $_GET['value5'],
),
),
) );
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question