Tagged: x
-
AuthorPosts
-
January 7, 2017 at 9:39 am #1320178
bperry420ParticipantHello,
I need to add the following javascript code to my site.
I am placing it in the Custom Global Javascript section of Customizer.Can I add it exactly like this or do I need to remove anything from it?
(This is code for a marketing tool called Net-Results)Here is the code:
<script id=”__maSrc” type=”text/javascript” data-pid=”15845″>
(function () {
var d=document,t=’script’,c=d.createElement(t),s=(d.URL.indexOf(‘https:’)==0?’s’:”),p;
c.type = ‘text/java’+t;
c.src = ‘http’+s+’://’+s+’c.cdnma.com/apps/capture.js’;
p=d.getElementsByTagName(t)[0];p.parentNode.insertBefore(c,p);
}());
</script>website URL: rdvsystems.com
wordpress version: 4.7
X Theme version: 4.6.4January 7, 2017 at 10:16 am #1320209
ThaiModeratorHi There,
Please add the following code under functions.php file locates in your child theme:
add_action( 'wp_head', 'add_custom_script' ); function add_custom_script(){ ?> <script id="__maSrc" type="text/javascript" data-pid="15845"> (function () { var d=document,t='script',c=d.createElement(t),s=( d.URL.indexOf('https:')==0 ? 's' : '' ),p; c.type = 'text/java'+t; c.src = 'http'+s+'://'+s+'c.cdnma.com/apps/capture.js'; p=d.getElementsByTagName(t)[0];p.parentNode.insertBefore(c,p); }()); </script> <?php }Regards!
January 7, 2017 at 12:07 pm #1320305
bperry420ParticipantThen what is the “global javascript” section for in the appearance / customize / custom area?
January 7, 2017 at 10:42 pm #1320752
ChristopherModeratorHi there,
That’s for adding JS code but what you have is a function and it should be added under child theme’s functions.php file.
Thanks.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1320178 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
