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]…
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.