Hey,
Where can I add code just before the </body> tag?
Thanks
Charlotte
http://www.newyorkinspiration.com
Something like this:
<script type=”text/javascript”>
(function() {var s = document.createElement(‘script’);s.type = ‘text/javascript’;s.async = true;
s.src = document.location.protocol + ‘//loader.wisepops.com/default/index/get-loader?user_id=18047’;
var s2 = document.getElementsByTagName(‘script’)[0];s2.parentNode.insertBefore(s, s2);})();
</script>
Hey!
You can use the wp_footer hook (place it in your theme / child theme functions.php):
add_action('wp_footer', function() {
?>
<script type=”text/javascript”>
(function() {var s = document.createElement(‘script’);s.type = ‘text/javascript';s.async = true;
s.src = document.location.protocol + ‘//loader.wisepops.com/default/index/get-loader?user_id=18047′;
var s2 = document.getElementsByTagName(‘script’)[0];s2.parentNode.insertBefore(s, s2);})();
</script>
<?php
});
Regards,
Josue
OK, thanks but what happens when I update the theme?
Will I lose it then?
Thanks
Charlotte
Hey!
Use this plugin to store the custom function there instead of the theme functions.php:
https://wordpress.org/plugins/functionality/
Best regards,
Josue
Thanks…
the code you suggested did not work in functions.php but when I added just my code in the footer file it worked.