Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #987301
    anilanvesh
    Participant

    Hello X Team,

    I want to place some code like Google analytics or verification code in header section of the theme. Where should I paste the code or where to find header section? I’m using Renew child theme. Do I need to copy any file to my child theme?

    #987310
    Christopher
    Moderator

    Hi there,

    Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Please add following code in child theme’s functions.php file :

    function third_party_tracking_code() { ?>
    
      <script>
        // Third party tracking code.
      </script>
    
    <?php }
    
    add_action( 'wp_head', 'third_party_tracking_code' );

    Hope it helps.

  • <script> jQuery(function($){ $("#no-reply-987301 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>