0

I have a query for custom post type as follow:

`$args = array('post_type' => 'interviews', 'posts_per_page' => 6, 'post_status' => 'publish', 'paged' => $paged);
$loop = new WP_Query($args);`

In my each interview post i have repeater value which returns only 1 value every time. I want to select those interview post which have particular repeater value only ...How can i write the query. I tried metakey and metanum value but dint work. In my post meta db metakey is 'speakers_0_speakers_relation' and meta value is 'a:1:{i:0;s:2:"76";}'. please help me

0

You're already on the right track, you just need to add the meta key and meta value args to the query

$args = array(
    'post_type'      => 'interviews', 
    'posts_per_page' => 6, 
    'post_status'    => 'publish', 
    'paged'          => $paged
    'meta_key'       => 'speakers_0_speakers_relation',
    'meta_value'     => '76'
);
$loop = new WP_Query($args);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.