Advanced Custom Fields
True False confusion (2 posts)

  1. phantomdentist
    Posted 3 years ago #

    I have had this issue with a few sites.

    I have created a true / false field. By default the field is unchecked (false) and I am using the following code

    <?php if( the_field('hide_next_previous_buttons') == false )
    		{ ?>
                <a href="#"></a>
                <a href="#"></a>
            <?php } ?>

    So the idea being if you tick the true false field, making it true, then the code above is not displayed.

    Instead the content of the if statement is always displayed, box ticked or not, and also when it is ticked a random number 1 is displayed after the code. Not sure if this is me making a mistake or a plugin issue?



  2. elliotcondon
    Plugin Author

    Posted 3 years ago #

    use get_field for retrieving values / condition statements

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advanced Custom Fields
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic