if (is_page(**PAGE ID**)) not working

Question

I’m following this tutorial on adding Google Content Experiments code to header.php.

I added the following code to header.php:

<?php if (is_page('346') ):?>
    <!-- Google Analytics Content Experiment code -->
        ...
    <!-- End of Google Analytics Content Experiment code -->
<?php endif; ?>

This didn’t produce the content experiment code on the front end. I tried:

<?php if (is_page(346) ):?>
    <!-- Google Analytics Content Experiment code -->
        ...
    <!-- End of Google Analytics Content Experiment code -->
<?php endif; ?>

This didn’t work either.

Can you see why this code is not working? Thanks.

0
Steve 1 year 2020-07-15T02:12:16-05:00 0 Answers 51 views 0

Leave an answer

Browse
Browse