Tagged: x
-
AuthorPosts
-
October 13, 2016 at 4:51 pm #1215303
Whidbey and Camano IslandsParticipantI’m trying to install Google Tags on a website. Previous questions to you all seemed to ask only about adding a single section of code, but now Google wants two sections of code added.
Their instructions for the first set of code is:
Paste this code as high in the <head> of the page as possible:
Their instructions for the second set of code is:
Additionally, paste this code immediately after the opening <body> tag:
I tried to follow this forum thread to add my code, but it just broke the site…
https://community.theme.co/forums/topic/wherehow-to-install-google-tag-manager-code-using-child-theme/
Can you give me some idea how it should go? From the above link I understand it goes in the functions.php file in my child theme, but any further assistance would be appreciated.And, just out of curiosity, is there a better way of doing this than via the functions.php file in my child theme?
Thanks.
Site: WhidbeyCamanoIslands.com
WP Version: 4.6.1
X Version: 4.6.4
Cornerstone version: 1.3.3October 13, 2016 at 10:33 pm #1215662
FriechModeratorHi There,
Thanks for writing in!
To place the code in the
<head>of the page, add the code below on your child theme’s functions.php file.add_action('wp_head','my_code1', 1); function my_code1 () { ?> <!-- PASTE YOUR CODE HERE --> <?php }Then this one is immediately after the opening
<body>tag, also add this on your child theme’s functions.php file.add_action('x_before_site_begin','my_code2'); function my_code2 () { ?> <!-- PASTE YOUR second CODE HERE --> <?php }Hope it helps, Cheers!
October 16, 2016 at 2:45 pm #1218435
Whidbey and Camano IslandsParticipantThis worked perfectly. Thanks…. again!
October 16, 2016 at 6:24 pm #1218592
NicoModeratorHappy to hear that
Feel free to ask us again.
Thanks.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1215303 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
