Home › Forums › General Issues › Using the true/false field to decide if a post is displayed › Reply To: Using the true/false field to decide if a post is displayed
<section id="channels" class="container">
<div class="rowOpen clearfix">
<div class="twelvecol">
<div id="masonary" class="nomargin">
<?php
$channels = new WP_Query(array('post_type'=> 'channels'));
while ($channels->have_posts()) : $channels->the_post();
if( ! get_field('show_on_channel_page')){ continue; } ?>
<div class="mason galleryItem">
<div class="img-contain border">
<a href="<?php the_field('channel_link'); ?>" target="_blank" class="img-shiv">
<?php $image = get_field('channel_logo');
if(!empty($image)) {
$imageResized = vt_resize( '', $image, 183, 183, false );
$imageTitle = get_the_title();
echo '<img src="'.$imageResized[url].'" height="'.$imageResized[height].'" width="'.$imageResized[width].'" alt="'.$imageTitle.'" class="statImg" />';
}
?>
</a>
</div>
</div>
<?php endwhile; ?>
</div>
</div>
</div>
</section>
(Thought i’d add it without any indents to make it easier to read)
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!
Are you building WordPress sites with ACF and @BeaverBuilder, and wanted to use your ACF Blocks in both the block editor and Beaver Builder?
— Advanced Custom Fields (@wp_acf) May 10, 2023
The BB team recently added support for using ACF Blocks in Beaver Builder. Check it out 👇https://t.co/UalEIa5aQi
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.