Home › Forums › General Issues › If True do this / False do that › Reply To: If True do this / False do that
I used your code, Tim and am getting this PHP error:
Error while parsing PHP: syntax error, unexpected 'else' (T_ELSE)
my code:
<?php if ( get_field( 'btn_show' ) ); ?>
<p class="text-center"><a class="btn" href="<?php the_sub_field('btn_url'); ?>"><?php the_sub_field('btn_text'); ?></a></p>
<?php else: // field_name returned false ?>
<?php endif; // field_name ?>
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.