managing large number of page ID’s with is_page conditional
-
Hello,
Is there a method that lets me take the page ID’s under the ‘if’ statement and put them somewhere else to manage and then refer to by a shorter name in a template. So then I can reuse a simpler word, such as I put into the 2nd code section below as ‘group 1’.
<?php
if ( is_page([1172,1170,1269,1271,1273])) {
the_field(‘exotic’, ‘option’);
?><?php
if ( is_page([group 1])) {
the_field(‘exotic’, ‘option’);
?>The reason is this same set of page ID’s will be repeated throughout in my template file to do different stuff, display custom fields mostly. And the list of page ID’s is going to be much larger.
thanks!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘managing large number of page ID’s with is_page conditional’ is closed to new replies.