Reputation: 4253
I want to add the following code to footer of my wordpress website. What would be the best possible way to do it.
<script async defer data-pin-hover="true" src="//assets.pinterest.com/js/pinit.js"></script>
Upvotes: 0
Views: 205
Reputation: 1159
You can use wp_footer hook to get this script in footer. Place the below code in your themes functions.php file.
add_action('wp_footer', 'add_script', 100);
function add_script(){
echo '<script async defer data-pin-hover="true" src="//assets.pinterest.com/js/pinit.js"></script>';
}
Upvotes: 0