Tagged: x
-
AuthorPosts
-
December 21, 2016 at 2:28 pm #1300889
cmdevParticipantI have installed X child theme, need to insert the following tag in the <body> of the site.
triflight.com
<!– Tracking tag. Place in the <body> section of webpage –>
<!– Privacy policy at http://tag.brandcdn.com/privacy –>
<script type=”text/javascript” src=”//tag.brandcdn.com/autoscript/tricitiesairport_vfhwtk5fmvvaeja9/TriCitiesAirport.js”></script>December 21, 2016 at 5:18 pm #1301021
FriechModeratorHi There,
Thanks for writing in! Please add the code below on your child theme’s functions.php file.
add_action( 'x_before_site_begin', 'tracking_tag' ); function tracking_tag() { ?> <!-- Tracking tag. Place in the <body> section of webpage Privacy policy at http://tag.brandcdn.com/privacy --> <script type="text/javascript" src="//tag.brandcdn.com/autoscript/tricitiesairport_vfhwtk5fmvvaeja9/TriCitiesAirport.js"></script> <?php }Hope it helps, Cheers!
December 22, 2016 at 3:14 pm #1302043
cmdevParticipantThis reply has been marked as private.December 22, 2016 at 7:45 pm #1302352
DarshanaModeratorHi there,
To add it on the header section, please refer to the following example.
add_action('wp_head','my_tracking_pixel'); function my_tracking_pixel() { ?> <!-- Add Your Tracking Pixel Here --> <?php }Hope that helps.
December 25, 2016 at 7:07 am #1303949
cmdevParticipantHow about adding to the opening <body> tag?
<!– Google Tag Manager (noscript) –>
<noscript><iframe src=”https://www.googletagmanager.com/ns.html?id=GTM-KR2PX7H”
height=”0″ width=”0″ style=”display:none;visibility:hidden”></iframe></noscript>
<!– End Google Tag Manager (noscript) –>December 25, 2016 at 8:28 am #1303974
ThaiModeratorHere you are:
add_action( 'x_before_site_begin', 'print_script_before_site_begin' ); function print_script_before_site_begin(){ ?> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KR2PX7H" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <?php }Regards!
December 26, 2016 at 11:32 pm #1305258
cmdevParticipantHelp, I added this and now my website is down!
December 26, 2016 at 11:32 pm #1305264
cmdevParticipantHow can i change my site back to the X theme without the child theme?
December 26, 2016 at 11:39 pm #1305300
FriechModeratorHi There,
You can easy remove or update the erroneous code with an FTP. Please provide us FTP credentials so we can take a look on the functions.php file.
We do not advice removing the child theme because it is necessary if you have customisation.
Thanks.
December 26, 2016 at 11:44 pm #1305303
cmdevParticipantI replaced the child theme with a fresh install of the child theme via FTP.
I have only been using it for the tags.Can you see what was the error?
December 26, 2016 at 11:51 pm #1305305
cmdevParticipantScreen shot attached.
Error added at top of screen when the edits are made to the function.php file.December 27, 2016 at 12:03 am #1305316
LelyModeratorHello There,
Thank you for the screenshot. There is syntax error on the functions.php file. If you do not have any other code, your child theme’s functions.php file should look like this:
<?php // ============================================================================= // FUNCTIONS.PHP // ----------------------------------------------------------------------------- // Overwrite or add your own custom functions to X in this file. // ============================================================================= // ============================================================================= // TABLE OF CONTENTS // ----------------------------------------------------------------------------- // 01. Enqueue Parent Stylesheet // 02. Additional Functions // ============================================================================= // Enqueue Parent Stylesheet // ============================================================================= add_filter( 'x_enqueue_parent_stylesheet', '__return_true' ); add_action( 'x_before_site_begin', 'print_script_before_site_begin' ); function print_script_before_site_begin(){ ?> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KR2PX7H" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <?php }Hope this helps.
December 27, 2016 at 12:07 am #1305319
cmdevParticipantThis reply has been marked as private.December 27, 2016 at 12:22 am #1305334
LelyModeratorHello There,
It should be something like this:
<?php // ============================================================================= // FUNCTIONS.PHP // ----------------------------------------------------------------------------- // Overwrite or add your own custom functions to X in this file. // ============================================================================= // ============================================================================= // TABLE OF CONTENTS // ----------------------------------------------------------------------------- // 01. Enqueue Parent Stylesheet // 02. Additional Functions // ============================================================================= // Enqueue Parent Stylesheet // ============================================================================= add_filter( 'x_enqueue_parent_stylesheet', '__return_true' ); add_action( 'x_before_site_begin', 'print_script_before_site_begin' ); function print_script_before_site_begin(){ ?> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KR2PX7H" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <!-- Tracking tag. Place in the <body> section of webpage Privacy policy at http://tag.brandcdn.com/privacy --> <script type="text/javascript" src="//tag.brandcdn.com/autoscript/tricitiesairport_vfhwtk5fmvvaeja9/TriCitiesAirport.js"></script> <?php } function third_party_tracking_code() { ?> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:";j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-KR2PX7H'); </script> <!-- End Google Tag Manager --> <?php } add_action( 'wp_head', 'third_party_tracking_code' );Check if the last google tag manager is correct.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1300889 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
