Home › Forums › ACF PRO › Show icon if checkbox is checked › Reply To: Show icon if checkbox is checked
Hi John
Here’s the full page code, less a few irrelevant bits…
<?php get_header(); ?>
<section class="content">
<?php
if (have_posts() ) {
query_posts($query_string . '&orderby=title&order=ASC');
while (have_posts() ) {
the_post(); ?>
<?php
$guests = get_field('guests');
$bedrooms = get_field('bedrooms');
$king = get_field('king');
$queen = get_field('queen');
$double = get_field('double');
$single = get_field('single');
$bunk = get_field('bunk');
$trundle = get_field('trundle');
$sofa = get_field('sofa_bed');
$lowday = get_field('low_day');
?>
<article class="promo">
<a href="<?php echo get_permalink(); ?>">
<img src="<?php the_field('accom_feature_photo', $post->ID); ?>" width="100%" alt="<?php the_field('accom_name');?> - <?php single_cat_title(); ?>" >
<?php if($lowday): ?><div class="price">from <span>$<?php echo $lowday; ?></span></div><?php endif; ?>
<h2><?php the_field('accom_name');?></h2>
</a>
<section class="quick-intro">
<?php if (has_term('dunsborough-holiday-homes', 'type')) : ?>
<ul class="quick-info">
<?php if ($guests): ?><li><i title="guests" class="fa fa-user" aria-hidden="true"></i> <span> <?php echo $guests; ?></span></li> <?php endif; ?>
<?php if ($bedrooms): ?><li><i title="bedrooms" class="fa fa-bed" aria-hidden="true"></i> <span> <?php echo $bedrooms; ?></span></li> <?php endif; ?>
<?php $pets = get_field('hh_facilities');
if( $pets && in_array('pet', $pets) ): ?><i ti-friendly" class="fa fa-paw" aria-hidden="true"></i>Pet<?php endif; ?>
</ul>
<?php endif; ?>
</section>
</article>
<?php
} // end while
} // end if
?>
</section>
<?php get_footer(); ?>
Thanks for taking a look
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!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz
— Advanced Custom Fields (@wp_acf) March 7, 2023
© 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.