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]…
It’s done in Laravel. I don’t know much about it, but to me this should be working. I don’t see anything that specifies it only shows on the home page, etc. It’s odd that is was supposedly working and now it’s not.
Here you go, John. Thanks!
<?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') && in_array($id, $spm_display_ids) === true)
@include('specials-modal')
@endif
@endif