Home › Forums › General Issues › Loop issue with checkbox › Reply To: Loop issue with checkbox
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!
The most recent ACF Chat Friday featured a live demo of how to register CPTs directly in the plugin, one of our most requested features. Check out the summary below for a replay of the demo, and don’t forget to register for the next session! https://t.co/k2KQ3WWBAz— Advanced Custom Fields (@wp_acf) March 9, 2023
© 2023 Advanced Custom Fields.