What I’m trying to do is query and display posts that have the T/F checkbox ticked, but this code isn’t working:
‘<?php
$posts = get_posts(array(
‘meta_query’ => array(
array(
‘key’ => ‘feature_in_blue_box’,
‘compare’ => ‘=’,
‘value’ => ‘1’
)
)
));
if( $posts ): ?>
<?php foreach( $posts as $post ): setup_postdata( $post ) ?>
-
<?php the_content(); ?>
<?php endforeach; ?>
<?php wp_reset_postdata();
endif; ?>’
Nothing displays on the front end. When I did the debug data from the $posts variable as directed by Support, it showed NULL. Any help greatly appreciated!
Sorry, it didn’t show my ul and li tags in the above snippet around the_content but you get the idea. All that is in there.