Check if is on child-page of a particular page

You can do that with $post->post_parent. You will have to check if child page’s parent is Services page. So this is how you will check it.

I assumed 123 in following code is page ID of your services page. Replace it with actual ID.

if ( 123 == $post->post_parent ) { ?>
    <div class="col-md-2 col-sm-4">
        <?php ci_e_logo('<h1 class="logo ' . get_logo_class() . '">', '</h1>'); ?>
    </div>
<?php }

Leave a Comment