Home Forums ACF PRO Radio Button not working in post loop


Radio Button not working in post loop

  • I have a CPT called packages. On these holiday package pages, the content is made up of ACF blocks.

    One of these contains basic information like, name, location, price etc – as well as a radio button asking if they would like to add a flag that says things like ‘popular’

    I have a template which outputs all this into an archive and it works as expected BUT I just can’t get the radio button to work, it doesn’t seem to pick up the value at all and I don’t understand why. It is driving me nuts!

    I have done this before with very little effort but for some reason, I just cannot get it to work this time.

    If the radio button field called ‘add_flag’ is equal to yes, I want to get the field flag_text which is a text field.

    This is what I have


    <section class="full-width-package-filter full-width-section cream-bg">
    	<div class="full-width-inner">
    		if ( have_posts() ) : ?>
    			<div class="package-listings">
    				<div class="listings-table-row">
    					while ( have_posts() ) : the_post(); ?>
    						<div class="package-wrapper teal-bg">
                               <?php if( get_field('add_flag') == 'yes' ) { ?>
       	                      <p><?php the_field( 'flag_text' ); ?></p>
                               <?php } ?>
                                <?php if ( has_post_thumbnail() ) : ?>
                                    <div class="package-home-image">
                                        <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
                                            <?php the_post_thumbnail(); ?>
                                <?php endif; ?>
                                <div class="home-package-title">
                                    <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
                                <div class="home-package-excerpt"> 
                                    <p class="excerpt"><?php echo $excerpt ?></p>										
                                <div class="home-package-button orange-bg">
                                    <a href="<?php the_permalink(); ?>"><button>Read More</button></a>
    						</div> <!-- package wrapper end -->
    					<?php endwhile; ?>
    				</div>  <!-- listings table row end -->
    				endif; ?>
    			<?php 	echo facetwp_display( 'facet', 'large_filter_pagination' );?>
    		</div> <!--  Package listings end -->
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.