Add to Header

2010-01-16 @ 14:49

Vita tänder kräver inte att man går till tandläkaren. Det går att göra hemma lika bra, med rätt utrustning. Sådant finns att köpa på nätet, så blek tänderna. Det är inte svårt.

The problem

If you need to add a stylesheet, a javascript file or Google Analytics code you normally need to edit your theme header.php file. If you do that your changes will be overwritten if you upgrade your theme.

The plugin

In short

  • Birth date: 2009-08-15
  • Last updated: 2009-08-15
  • Version: 1.0
  • Tested with version: 2.8
  • Requirements: PHP5

Download

  • Download from: devdevote.com
  • Download from: wordpress.org (coming soon)

Benefits

Add additional code to your header WITHOUT editing your theme:

  • Stylesheets (CSS)
  • Javascript (JS)
  • Google Analytics
  • Metadata
  • Anything else

Example usage

  • Change your downloaded theme visually without changing it, by adding an extra stylesheet. If you update your theme your changes will still be intact.
  • Add Google Analytics without changing your theme. If you update or change your theme, Google Analytics will still be there.

Screenshots

Add to Header

Installation

  1. Upload the FOLDER ‘add-to-header’ to /wp-content/plugins/.
  2. Activate the plugin ‘Add to Header’ through the ‘Plugins’ menu in admin.
  3. Go to ‘Settings’ and then ‘Add to Header’ to add header code.

Changelog

  1. 1.0 – Initial release.

Known issues

None reported so far.

Possible future features

  • Add footer code through wp_footer().
  • Add shortcodes to insert code within posts / pages.
  • Add multiple codes to header, footer and shortcodes.
  • Add functions to themes to add code.
  • Add PHP code.

Contribute

  • Report bugs.
  • Report if it works with other versions with WordPress.
  • Spread the word. Blog about it, tell your friends, link to this page and so on.
Share
RSS-feed for comments

26 replys to “Add to Header”

  • baron »
    2009-08-16 @ 12:24 e m

    Works great, thank you

  • MacBoy
    2009-08-19 @ 12:35 e m

    Can you allow us to add PHP code into the Header via this plugin ?

    I’d want it to be the code executed prior to the tag in the header.

  • Shane »
    2009-09-02 @ 1:36 e m

    I am trying put the photo that is in my sidebar into the header but when I use this plugin, the photo doulbes ie its put 2 there, it duplicates them, any idea why this would be?

    • admin
      2010-01-17 @ 2:15 e m

      I have no idea. The plugin just takes the code written in the textbox and add it to the header through the function wp_head. Check the code again to see if you have written the code two times by mistake?

      By the way, text and photos should not be between the head-tags. It should be somewhere between the body-tags. Scripts, CSS, metadata and so on are head-stuff. Images are not.

  • OP351net »
    2010-01-10 @ 2:50 e m

    Great! It’s working on the WP-v2.9.1… Thanks.

  • Eric
    2010-05-21 @ 5:14 e m

    This works wonderfully, thanks! But I’m curious…the default placement of an added chunk of code is in front of/above the current header. I’m wondering if there’s a way to place the code directly after the current header…a blog-wide subhead as it were. Something between the header and the content.

  • John
    2010-08-30 @ 9:12 e m

    Great idea and serves a real need but wondering if there is a way to have it load after all other plugins so my style include could overwrite previous includes without me modifying their code or my own header file directly. Maybe this is more of a plugin load question…

  • john
    2010-08-30 @ 9:32 e m

    …in response to my previous comment, i see that plugin order is determined by plugin name (alpha ordered) so renaming to z_ + name fixed it for me. thanks again for your helpful plugin!

  • Robert Merrill »
    2010-10-14 @ 5:20 e m

    Any chance you know of an ”add to footer” plugin (or would write one)? It’d be cool if this plugin allowed you to add to the header and the footer in the same plug. Nice work.

  • computer repair boca raton »
    2010-10-31 @ 5:45 e m

    Hi, I like your theme… did you purchase it or is it unique? I am in search of a theme like this for my website but haven’t discovered anything as nice as this.

  • Add to Header | Scripts United »
    2011-02-03 @ 5:59 e m

    […] Translate Widget für WordPress »Add to HeaderPubliziert 19. Februar 2010 | Von khkAdd to Header von devdevote.com fügt über eine Textbox im Adminbereich beliebigen Code in den Header des Blogs […]

  • Freddie Markstrom »
    2011-04-13 @ 2:25 e m

    Thanks for this post. It is very useful and time saver.

  • Tom
    2011-05-26 @ 9:25 e m

    This plugin is not working in WP 3.1.2

  • Yves
    2011-06-19 @ 11:15 f m

    Works fine in WordPress 3.1.3. !
    Great Job, you’ve done here, Thank you !

  • Rasika »
    2011-07-06 @ 12:53 e m

    How do we remove the added code ?

  • Two additional ways to get banner management on WordPress | chimac.net – Stuff worth knowing about »
    2011-07-17 @ 12:35 f m

    […] sec­ond one and the one I am using now is Add to Header. It is fan­tas­tic and even though devel­oped long ago, still com­pat­i­ble. He did a great […]

  • Preston Crawford »
    2011-07-20 @ 6:19 e m

    Trying to use this with my site and I’m not seeing a ”settings” link by the plugin. Any idea why this might be?

  • Donald Haas
    2011-08-08 @ 6:13 e m

    Jens,

    Nice work, IMHO.

    Question: If I have already created a header.php file in my child theme, will ATH put its code there or in the WP header.php file? Or, is there a way to direct the plug-in to a specific header.php location?

    Thank you for your time and attention.

    Best,

    don

  • Jennifer Crane »
    2011-08-17 @ 11:19 e m

    I added my banner java to the add to header plugin, but is there anyways I can get the banner to display directly below the header image and menu, and above the content?

  • Houston SEO Companies »
    2011-09-13 @ 3:10 f m

    Great plugin, did the job that we were looking for. I recommend it to everyone looking for an easy fix.

  • Need a simple Banner plugin for Wordpress? » chimac.net – Stuff worth knowing about »
    2011-12-30 @ 5:41 f m

    […] option is called Add to Header. It works on many themes in which Bannerman failed to work on. I think it is more straightforward […]

  • Henry Cline »
    2012-01-02 @ 6:04 f m

    I installed your plug in, but the resulted js is aligned left, can you please help me align in center over the header? Thanks so much for developing a great plug in.

  • Henry »
    2012-03-16 @ 1:20 f m

    Thanks for this, very helpful.

    I am having an issue that after I place the code I also have to to align it center, but after that the entire blog is aligned center?

    Can you help me align the code to the header center withouth affectin gthe rest of the blog?

    The header code I am adding is a .js script

  • 12 »
    2012-05-27 @ 5:10 f m

    Add to Header – WordPress plugin – Script & code, stylesheet (CSS), Javascript (JS) & Google Analytics | devdevote.com I was suggested this website by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my difficulty. You are amazing! Thanks! your article about Add to Header – WordPress plugin – Script & code, stylesheet (CSS), Javascript (JS) & Google Analytics | devdevote.comBest Regards Agata

  • Nory »
    2013-01-15 @ 6:42 e m

    Jens, that’s a great little plugin. Many thanks.

  • Hugh
    2013-07-11 @ 1:13 f m

    Great plugin. Thanks! I’m happy to make donation to help support this plugin.

Leave a reply