Home › Forums › General Issues › Loop issue with checkbox › Reply To: Loop issue with checkbox
Hi,
I have the same situation but with multiple checkbox,
select_section = is where the post will be displayed (fine with that)
pin_article = is a checkbox with few options (project is one of them), when is checked this post should be pinned on project page.
Problem is making the pinned post to be displayd first on project page.
work fine with single checkbox but with multiple values is not working anymore.
Any solution to that?
$query_args = array(
'numberposts' => -1,
'posts_per_page' => 4,
'post_type' => 'project_post',
'meta_key' => 'pin_article',
'orderby' => 'meta_value',
'meta_query' => array(
'relation' => 'OR',
array(
'key' => 'select_section',
'value' => 'home',
'compare' => 'LIKE'
),
array(
'key' => 'pin_article',
'value' => 'project',
'compare' => 'LIKE'
)
));
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.