Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 4 years ago.
Improve this questionTrying to use google tag manager. It requires code in the . I tried editing the theme for our website but its returning a white screen see the below code before I add Tag Manager
echo '<body class="'.implode (' ',get_body_class()).'">';
$body_top_scripts = get_theme_mod( 'scripts-at-beginning-of-body', '' );
if(trim($body_top_scripts) <>'') echo $body_top_scripts;
after....
echo '<body <!-- Google Tag Manager (noscript) -->
<noscript><iframe src=".html?id=notgonnashowdis"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) --> class="'.implode (' ',get_body_class()).'">';
$body_top_scripts = get_theme_mod( 'scripts-at-beginning-of-body', '' );
if(trim($body_top_scripts) <>'') echo $body_top_scripts;
What can I try? I don't know what ( 'scripts-at-beginning-of-body', '' );
is tbh but it looks like something I should find.
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 4 years ago.
Improve this questionTrying to use google tag manager. It requires code in the . I tried editing the theme for our website but its returning a white screen see the below code before I add Tag Manager
echo '<body class="'.implode (' ',get_body_class()).'">';
$body_top_scripts = get_theme_mod( 'scripts-at-beginning-of-body', '' );
if(trim($body_top_scripts) <>'') echo $body_top_scripts;
after....
echo '<body <!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager/ns.html?id=notgonnashowdis"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) --> class="'.implode (' ',get_body_class()).'">';
$body_top_scripts = get_theme_mod( 'scripts-at-beginning-of-body', '' );
if(trim($body_top_scripts) <>'') echo $body_top_scripts;
What can I try? I don't know what ( 'scripts-at-beginning-of-body', '' );
is tbh but it looks like something I should find.
1 Answer
Reset to default 1I resolved my own issue with some research on the theme_mod()
Turns out it added a section to the customizer in WordPress and actually allows me to use custom JavaScript in the body.