Im trying to simply just output some HTML onto these 3 specific page-ids that I am referring too in the code below. Does anyone have any ideas as to why this php isn’t working? (its at the bottom of my functions.php file in the child theme.
if( is_page('96') || is_page('98') || is_page('61') ) { ?>
<div class="test"><h2>test content</h2></div>
<?php }
Any help would be appreciated as to why this ‘test content’ is not appearing on these pages.
Thanks!
2
Answers
You can use
get_the_ID();
or$post->ID;
. you will get the ID of the current post of the looplike this
Please take a look at the docs :
Try the below code that will work properly.
===================== or ==========================