Advanced Custom Fields radio button and if statement

I am using ACF successfuly on my WordPress site, but cannot get an if statement to work with a ACF radio button that I have created.

Here is a grab from ACL of the radio button, as the code below that.

Read More

Any guidance on what I’m missing here would be appreciated.

Thanks in advance.

ACL

<?php if( get_field('event_main_link') == 'disable' ): ?>


    xxxx
<div class="event-header-content">
<div class="event-header-button">
<?php the_field('event_button'); ?>
</div>
</div>
<div class="clear"></div>

xxxx


<?php else : ?>
xx
<div class="event-header-content">
<h2 class="post-title"><?php the_title(); ?></h2>
<p><?php the_field('event_header_blurb'); ?></p>
<p><?php the_field('event_header_date'); ?></p>
<div class="event-header-button">
<a href="<?php the_permalink(); ?>"><?php the_field('event_button'); ?></a>
</div></div>
                            <div class="clear"></div>

xx
<?php endif; ?>

Related posts

1 comment

  1. Just added a new post and the above is working perfectly now. Strange that it wasn’t working before, after a cache clear.

Comments are closed.