Thanks for the help, changed few extra strings to make everything work as I want to. As for value ‘1’ or TRUE(both work fine) I misspelled and wrote show_main in the key instead of show-main, heh.
In case if someone will need this
<?php $posts = get_posts(array( 'cat' => $current, 'post_type' => array( 'page' ), 'numberposts' => -1, 'meta_query' => array( array( 'key' => 'show-main', 'value' => '1', ) ) ) ); if( $posts ): ?> <?php foreach( $posts as $post ): setup_postdata( $post ) ?> loop <?php endforeach; ?> <?php wp_reset_postdata(); ?> <?php endif; ?>
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!