Problem with is_page in header.php
-
Hello guys,
So I want to insert Facebook Tracking Pixel code to <head> tag of my website. Plus additionally I want different version of the code to be inserted in one specific page.
So here’s what I did:1. created two functions in functions.php (function_1 , function_2) inserting adequate code to each.
2. put this into header.php:<?php if ( is_page(123) ) { function_1(); } else { function_2(); } ?>Now the problem: no matter if I’m on the page ‘123’ or any other page, in the <head> section I see both codes inserted. From function_1 and right after that function_2.
What might be wrong?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Problem with is_page in header.php’ is closed to new replies.