Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #776064

    DanielWiele
    Participant

    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.

    #776299

    Rupok
    Member

    Hi 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!

    #776345

    DanielWiele
    Participant

    Thanks 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

    #776852

    Darshana
    Moderator

    Hi 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.

    #777003

    DanielWiele
    Participant

    Are 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

    #777237

    Prasant Rai
    Moderator

    Hello 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.

    #783005

    DanielWiele
    Participant

    Helps a lot. Thank you!

    #783191

    Thai
    Moderator

    You’re very welcome 🙂