Is there a way around editing the php files and have access to the source code? Need to paste some tracking code (from Facebook ads) into the <header> of some of our pages.
Hi,
If you go to appearance>editor you get a list of all theme and child php files.
You can use a php function to add your tracking script to certain page by editing the header.php.
Hope that helps a little
TJ
Thanks TJ, that does help though I’m honestly not very familiar with php, more with html/xml. Will look into your proposed solution.
Hi,
Please add following code to Functions.php file in Appearance > Editor
function my_custom_code_head(){
?>
//Your code goes here
<?php
}
add_action('wp_head', 'my_custom_code_head');
Best regards,
Yigit
Hi,
I use this php to add tracking code straight in the header of certain pages. this code needs to be in the header.php before the </head> tag
<?php if (is_page(xxx)) { ?>
<script>
//tracking code here
</script>
<?php } ?>
changing the xxx for the page id number.
Do be careful when changing php files as mistakes can crash your site. You’ll then need ftp access to get in and remove the changes.
Thanks
TJ
Thanks TJ and Yigit,
Very helpful input indeed and yes, we will be careful!
Hi,
You are welcome! :)
For your information, you can take a look at Enfold documentation here – http://kriesi.at/documentation/enfold/
And if there are features that you wish Enfold had, you can request them and vote the requested ones here – https://kriesi.at/support/enfold-feature-requests/
For any other questions or issues, feel free to post them here on the forum and we will gladly try to help you :)
Best regards,
Yigit