Support

Account

Home Forums General Issues ACF Relationship Type Issue Reply To: ACF Relationship Type Issue

  • I actually put the wrong code up. Here’s the correct code:

    <?php 
    $spm_display_ids = get_field('spm_display_ids', 'options');
    $id =  get_the_ID(); 
    ?>
    
    @if ($spm_display_ids != null)
      @if (get_field('toggle_sm', 'options') && $spm_display_ids[0]->ID == $id)
        @include('specials-modal')
      @endif
    @endif

    The reason it’s not showing up on all pages is because of the spm_display_ids[0]. That means it’s only showing on the first page in the list box. Is there a way to list all of the pages? Ie. [0],[1]…