Title: Adding Javascript Ad Code Above Header
Last modified: August 18, 2016

---

# Adding Javascript Ad Code Above Header

 *  [meshsf](https://wordpress.org/support/users/meshsf/)
 * (@meshsf)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/adding-javascript-ad-code-above-header/)
 * I have no experience with CSS or PHP, but I’ve been messing around with both 
   in the last couple of days. I’m trying to ad the code below above the header 
   here:
    [http://www.meshsf.com/blog1/](http://www.meshsf.com/blog1/).
 * Like this site has here: [http://www.stereogum.com/](http://www.stereogum.com/).
 * `
    <script language='JavaScript' type='text/javascript'> <!-- if (!document.phpAds_used)
   document.phpAds_used = ','; phpAds_random = new String (Math.random()); phpAds_random
   = phpAds_random.substring(2,11);
 *  document.write ("<" + "script language='JavaScript' type='text/javascript' src
   ='");
    document.write ("http://campaign.indieclick.com/adjs.php?n=" + phpAds_random);
   document.write ("&what=zone:274"); document.write ("&exclude=" + document.phpAds_used);
   if (document.referrer) document.write ("&referer=" + escape(document.referrer));
   document.write ("'><" + "/script>"); //--> </script><noscript>[<img src='http://campaign.indieclick.com/adview.php?what=zone:274&n=ae1dd888' border='0' alt=''>](http://campaign.indieclick.com/adclick.php?n=ae1dd888)
   </noscript>`
 * I tried searching in the forums, but the only advice that seems related is “just
   put the code where you want it to appear” and “put it in header.php,” both of
   which are too vague for me. Is it possible just to dump that code somewhere, 
   or do I have to add more code to it?
 * And if I am in way over my head, you could let me know that too.
 * Thanks a lot,
    Brian

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [spencerp](https://wordpress.org/support/users/spencerp/)
 * (@spencerp)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/adding-javascript-ad-code-above-header/#post-473474)
 * Might want to start over [here](http://codex.wordpress.org/using_javascript),
   and [there](http://codex.wordpress.org/designing_headers)..? Good luck!
 * spencerp
 * /I AM NOT, a “pro” at adding in Javascript codes to the header.. so, maybe someone
   else can chip in, on this thread..?
 *  [johnpannell](https://wordpress.org/support/users/johnpannell/)
 * (@johnpannell)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/adding-javascript-ad-code-above-header/#post-473497)
 * Couldn’t you add this to your header.php (or similarly named file) for the theme
   you’re using? That would seem the logical place to put it.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding Javascript Ad Code Above Header’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [johnpannell](https://wordpress.org/support/users/johnpannell/)
 * Last activity: [19 years, 7 months ago](https://wordpress.org/support/topic/adding-javascript-ad-code-above-header/#post-473497)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
