Header and Footer Scripts

Almost every website has to insert some codes to their website. It could be web analytics like Google Analytics or social media button. With Header and Footer Scripts plugin you will be able to could be used to insert JavaScript, CSS and HTML code.

What does this plugin do?

Using wp_head and wp_footer hooks, the plugin inserts your html codes to

  • <head> section of your site,
  • before </body> of your site, and
  • <head> section of a single post or page.

Note: You should not add html elements like div, span, text, or other elements in the. Also, do not forget to wrap your code properly with appropriate tags like: <script>Your code here</script> or <style>Your code here</style> or other variations.

What can you do with this plugin:

  1. Insert Google Analytics into your site.
  2. Verify your site in Google Webmaster tools
  3. Add Google Fonts to your site.
  4. Add CSS to your website Header
  5. Add CSS, JS to single post or page header.

You can actually do a lot more things. But, we have mentioned some of the common things we do.

Note: This plugin will not execute any PHP code. And your theme must have wp_head or wp_footer hooks. Almost all themes do have those.

How to Install this plugin:

To Install and activate this plugin follow the standard procedure. Once the plugin is active you will see These 2 things:
1. A menu item under settings in WordPress dashboard which will take you to sitewide options panel
2. A meta box on the New/Edit Post and New/Edit Page. There is a chance that this option is hidden. Follow this tutorial to make them visible.

Find this screen in Settings
You will find this meta-box in while writing new or editing old posts and pages.

Take a look at the screen-shots for clarity.

How to insert code/scripts:

If you want to add your codes to your whole site visit: WordPress Dashboard --> Settings --> Header and Footer Scripts and add your HTML code.
If you want to add your codes to individual post/page go to the page edit window and find the meta box titled “Insert script to”. If the meta box is not visible then you should click on “Screen Option” in the top right corner and make sure the check-box saying “Insert script to” is checked.

If you can’f find the meta box on post/page edit

Need Help? Contact support