Home › Forums › General Issues › Select posts for loop based on whether an array contains value or not › Reply To: Select posts for loop based on whether an array contains value or not
global $post; $current_page = $post->ID; $int = (int)$current_page; $string_page = (string)$current_page; $current_parent_page = $mv_is_subpage->ID; // Post selection $args = array ( 'post_type' => $post_type, 'posts_per_page' => $posts_per_page, 'orderby' => $orderby, 'order' => $order, 'no_found_rows' => 1, // 'category_name' => 'test' 'meta_query' => array( array( 'key' => 'assigned_page', 'value' => "$string_page", 'compare' => 'LIKE' ) ), );
Also you have some strange parameters such as “no_found_rows” and “category_name” which does not exist in the wp_query class.. These should probably be removed if you dont know what you’re doing with them.. And make sure that your variables such as $order etc. is set!
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 ACF site is currently experiencing some issues.— Advanced Custom Fields (@wp_acf) September 29, 2022
We apologize for the inconvenience and we are working hard to get it back up and running as soon as possible.
© 2022 Advanced Custom Fields.