Support

Account

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 ?>