This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

How to add code within the head tag

  • Creator
    Topic
  • #7232
    kmcmean
    Participant

    Hi
    I want to add some Google verification code to my theme header and not sure how to do it. I don’t have a child theme set up.

    Thanks
    Keith

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #7236
    Jason Bobich
    Keymaster

    Hello,

    1) If it’s just a temporary thing, you could always just put it in header.php of the theme, but I wouldn’t suggest altering any theme files and leaving them like that, as you’re going to have problems with updates in the future.

    2) You could set up a child theme and hook to wp_head from your Child theme’s functions.php as any plugin could.

    function my_stuff(){
    	?>
    	your stuff for the <head> ...
    	<?php
    }
    add_action( 'wp_head', 'my_stuff' );

    3) You could find a plugin that possibly helps with the specific task:

    http://wordpress.org/extend/plugins/search.php?q=google+verification

    4) You could find a plugin that just allows you to insert scripts into your site:

    http://wordpress.org/extend/plugins/search.php?q=javascript+add

    5) I’m no expert on Google Analytics and webmaster tools, but maybe the trick is to insert your analytics with this plugin instead of using the theme’s option.

    http://wordpress.org/extend/plugins/analytics-head/

    #7242
    kmcmean
    Participant

    That’s brilliant thanks, I will give it a try and let you know how I get on?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The forum ‘Swagger Responsive WordPress Theme’ is closed to new topics and replies.