Tagged: custom code, functions.php
Hello,
I have 2 different codes in use on different Enfold child themes in my functions.php that add Clicky Analytics code to my website.
On some of my websites I use this code:
function alwin_clicky_analytics_footer(){
?>
<script src=”//static.getclicky.com/xxxxxxxx.js”></script>
<?php
}
add_action(‘wp_head, ‘alwin_clicky_analytics_footer’);
And on some websites I use this:
function clicky_analytics_header(){
?>
<script type="text/javascript">
<script src="//static.getclicky.com/xxxxxxxx.js"></script>
</script>
<?php
}
add_action('wp_head', 'clicky_analytics_header');
They both seem to work fine. I just like to know if one may be better then the other?
or :
;)
function clicky_analytics_header(){
?>
<script type="text/javascript" src="//static.getclicky.com/xxxxxxxx.js"></script>
<?php
}
add_action('wp_head', 'clicky_analytics_header');