Support

Account

Home Forums Front-end Issues How to search ACF Post Object Type Field Reply To: How to search ACF Post Object Type Field

  • Replace ‘paged’ => $paged by ‘posts_per_page’ => -1,

    
    	$args = array(
    		'post_type' => 'recipes',
    		'post_status' => 'publish',
    		'posts_per_page' => -1,
    		'meta_query' => array(
    			array(
    				'key' => 'cookies_products_used',
    				'value' => $ptype,
    				'compare' => 'LIKE'
    			)
    		)
    	);
    
    // start get values you want
    	$the_query = new WP_Query($args);
    	if ($the_query->have_posts()) {
    		while ($the_query->have_posts()) {
    			$the_query->the_post();
    			
    			// for example
    			$cookies_products_used = get_field('cookies_products_used',get_the_ID());
    		}
    	}