-
AuthorPosts
-
February 2, 2016 at 8:39 am #776064
Hello,
I’ve searched this forum for a few hours and still have not figured out to add tracking code to my header tag.
I have the child theme installed and understand I need to find the right file in the directory.
Do I access this in my CPANEL? It seems like every answer is slightly different…
Also, what is the difference between adding code to all of my pages, vs two pages if I want to do a Split Test?
Do you know of any plugins that do this automatically that are compatible with X?
Please help!!
One last question, how do I confirm my Child theme is active and my work won’t get overwritten in an update?
Thanks.
February 2, 2016 at 10:52 am #776299Hi there,
Thanks for writing in! You can add your scripts like below on your Child Theme’s functions.php
function my_custom_head_output() { ?> <script type="text/javascript"> // Add your custom scripts here </script> <?php } add_action( 'wp_head', 'my_custom_head_output' );
If you wish to achieve this through plugin, then you can try this : https://wordpress.org/plugins/header-and-footer-scripts/
If you activate Child Theme you can see the active theme from Appearance > Themes. You don’t need to update Child theme and the update of parent theme won’t override anything on Child Theme.
Hope this makes sense.
Cheers!
February 2, 2016 at 11:29 am #776345Thanks for the response.
HOW do i find the Child Theme functions.php ? Is this in the CPanel? Or is this accessible through the WP Dashboard?
Also, how do I go about adding code to a specific page (not all the pages) for the purpose of split testing?
Thanks
February 2, 2016 at 5:11 pm #776852Hi there,
You will need to setup a child theme first. Please refer to our knowledge base section for that (https://community.theme.co/kb/how-to-setup-child-themes/).
Then you can find the functions.php file inside your child theme folder.
Hope that’s clear.
February 2, 2016 at 7:10 pm #777003Are my questions outside the scope of what you address?
I’m sorry but, no it’s not clear.
So is the functions.php accessible through the WordPress dashboard? If so how and if not how do I access it?
Thanks
February 2, 2016 at 10:26 pm #777237Hello Daniel,
Thanks for updating the thread!
You can access function.php file from WordPress admin dashboard and via FTP also. To open child theme function.php file please navigate to Appearance > Editor > functions.php.
In-order to access function.php file via FTP using Filezilla. Next you need to go to /wp-content/themes/x-child/functions.php.
Hope that helps.
Thanks.
February 6, 2016 at 7:46 am #783005Helps a lot. Thank you!
February 6, 2016 at 10:23 am #783191You’re very welcome 🙂
-
AuthorPosts