Home › Forums › Front-end Issues › 1 Custom post type, 2 different meta-values, same loop? › Reply To: 1 Custom post type, 2 different meta-values, same loop?
Thanks for posting the code. Can you please edit your original post and remove any code which is redundant.
If the problem is that your query is not working, then there is no need to post the loop code as it is confusing to readers.
Can you please be specific as to what is and isn’t working in your code. Is your original WP_Query working as expected? Does it loop? Does it return posts?
I have a feeling that your issue lies in the meta_query args you have written.
You say that you are using a radio field to choose between ‘image’ and ‘video’. Firstly, can you confirm the value saved is ‘Image’ or ‘image’ – this is important.
Becuase the radio field only saves 1 value, it does not require the LIKE compare – this is only needed for serialized array values such as checkbox.
So you can change your args to:
'meta_query' => array(
'relation' => 'OR',
array(
'key' => 'slide_media_format',
'value' => 'Image',
),
array(
'key' => 'slide_media_format',
'value' => 'Video',
)
)
Hope that helps.
Thanks
E
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.