How to add piterest Tag to Header

Hello,

I have been trying to add my Pinterest tag to the header of my the X theme. But

  1. I Cant find the header
  2. I have been reading and it says that i need to make the changes to the child theme, if so how is this done?
  3. I read a response that i had to download the plugin “Insert Header and Footer” but i dont see where to insert this code in there.

I need please please…
Thank you

Hi @awimartinez,

After set up a child theme, please add the following code under functions.php file locates in your child theme:

function adding_scripts_to_head(){
	?>
	<script type="text/javascript" async src="//assets.pinterest.com/js/pinit.js"></script>
	<?php
}
add_action( 'wp_head', 'adding_scripts_to_head' );

Don’t forget to replace this code <script type="text/javascript" async src="//assets.pinterest.com/js/pinit.js"></script> with your pinterest tag.

Hope it helps :slight_smile:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.