Support

Account

Home Forums General Issues Footer conditional field display is not working in blog page and single posts Reply To: Footer conditional field display is not working in blog page and single posts

  • The problem is that when you’re in the footer that WP/ACF doesn’t know what post to get the field from. In this case you need to supply the post ID. This is covered in the get_field() documentation http://www.advancedcustomfields.com/resources/get_field/ and this is how you can do that

    
    <?php 
      $queried_object = get_queried_object();
      if( get_field('sub_footer_section', $queried_object->ID) ):
        <section class="subfooter">
          //with a few of:
           the_field('field_name', 'options');
        </section>
      endif;
    ?>