How to Add Google Adsense Ad Under Navigation Menu in WordPress

Google Adsense can generate huge revenue if you can use it wisely. One of the best way to increase revenue is placing ads on different  places of your website. After few research we found that Ads under Navigation Menu works GREAT. Its CTR is high.

You can use different Ads like Leaderboard (728 x 90) or (728×15) Displays 4 links. For me, Link Unit generates more click, though earning isn’t so high.

So in this post I’ll show you how to add Adsense ad under nav menu in WordPress.

How to Add Google Adsense Ads Under Navigation Menu

If you are going to use Link Unit then I suggest you to make it look like navigation bar. Change the background and text link color according to your navigation menu just like this:

Add Adsense in Thesis

For Leaderboard, use Image/rich media ads only.

Now follow the simple steps.

1. At first, Login your Adsense Account and create you desire ad unit. Copy the code.

2. After copying the code, login to WordPress dashboard. Go to Editor and Find Header.php file on the editor.

3. Open the header.php file and paste the Adsense codes at the bottom of the file.

4. To make it center just use the center tags like <center>Google Adsense Code</center>.

WordPress Guide

That’s it you’re DONE. 

If you’re using Thesis 1.8 then just follow the bellow steps.

1. At first take a back up of your custom_functions.php and Custom.css file which are to be used in this steps. In case of any mistake you can back up will help you.
2. Now put the following code in your custom_functions.php file.

function addmenu() { ?>
<ul id=”addmenu”>
<?php }

Click on save button.

3. Then put the following code on your Custom.css file.

.custom ul#addmenu {
height: 20px;
background:#E6E6E6 none repeat scroll 0 0;
padding-top: 5px;
width: 100%;

Click on save button and you are done.

Also Read: How to manage your Ads in every post with ‘Post Layout’ Plugin

Hope this post helps you to put Adsense Ads under nav menu. Do let us know if you face any difficulty via comments. If you find this useful consider sharing with your friends.

Istiak Rayhan

Istiak Rayhan is the founder of, a blog that aims to make bloggers' journey easier. Istiak loves to help newbie bloggers to build a better blog. Here's more about him.


Leave a Reply:

Adesanmi Adedotun

I’m not not an expert in coding and I don’t want to mess everything up, is there a way I can have this done using plugin?


not working

Avinash Kumar

Thanx for such great post. I have installed ads just below header on my blog. 🙂


Awesome! Simple and straight to the point. Thanks for your help!


Hi i have the splash theme by mythemeshop do you know how i can how this type of adsense code like the 728 by 15 under the header?

thank you


its not working on my site plz visit and tell the solution


Worked great on my site. Thank you.


thanks buddy it worked for me….


Hi Istiak,
The above article is really useful and I want to use it myself, but since I am new to thesis I have a doubt.
1) I cannot find custom.css and custom_functions.php under my wp-content\themes\thesis\ folder. Having said that there should have been a ‘custom’ folder as well right?
2) Or is it that these two files get created only when i actually start customizing? I thought they should be available by default.

Can you please help me I’m unable to get any answers


    Istiak Rayhan

    I’ve just checked your site. You are using Thesis 2. This tutorial is for Thesis 1.x.

    For Thesis 2, you can do it using drag and drop page builder.


Hello there, I use fashionista theme from for my blog. How can I add adsense under my main menu navigation? You mentioned that this is only for thesis theme? I would appreciate if you could help me. Thanks.

    Istiak Rayhan

    This tutorial has two parts. First part is applicable for all WordPress Theme and second part is for only Thesis 1.8. Hope you got your answer.


HI i try this but it show ad on home page also. how to only show ad when post is open ?

    Istiak Rayhan

    I am afraid I don’t have any idea ‘how to do it’.


I will do it for my blog.thanks for sharing the tips.

    Istiak Rayhan

    Unfortunately this post is for WordPress Blog, not for Blogspot blog.


I have thesis 1.8 and i pasted both of the codes in the file and waited for more than 24 hours.. nothing happened. Dp i have to remove the * in the first code?

    Istiak Rayhan

    Hey Shivani,
    Yes you need to remove that * from the code. Just Put your adsense Code there. Without the *.
    Hope this helps.


this doesnt work for me! I tried like 4 times. Do you know what could be wrong?


Most useful tutorial sir. I already use it and find it’s work, before this don’t have any idea to adjust my ads position

Taswir Haider

Good guide Rayhan. This is a perfect place to add link units under navigation menu. I also tried them once but later stopped as link units need to be clicked 2 times to get any revenue.
Still link units blend nicely with the navigation menu, so I really love the placement.


the post is really cool and awesome..
it helps me….


Thanks for the great tutorial! It always bothered me so much that I couldn’t center my leaderboard ad! But now I have a different problem, and that is that I have way too much space between the menu under the header and the links ad. Is there any way I can get rid of all that white space?
Also, how can I attach the links to the menu like you suggested?
Thank you very much!

    Istiak Rayhan

    I am sorry to say that I’ve no idea about how to fix it.

sanyam jain

How to put same in genesis 1.8.2???

    Istiak Rayhan

    I have no idea how to do it on Genesis. But you can get it from Genesis Support.


Can you tell me about another themes. I don’t use thesis theme. Check my site and suggest me please , how can I put it on my site. Tnx in advance bhai.

    Istiak Rayhan

    Hey Muminur,
    You are using a premium theme from themeforest. Just ask the theme Author. He will help you with this. Thank you for stopping by.



Is there any plugin which can do this ? I am new to wordpress and just don’t to mess up anything.


I have this on a niche site – and then when I upgraded to Thesis 2 I can’t see where the code is because we no longer have the same files to edit (and I haven’t learned about skins and packages yet). Is there an easy way to remove this or at least find it if I want to remove it? Thanks!


Thank you very much for the nice sharing. Will try it to increase my adsense revenue.


Thanks for the sharing of the method to place the adsense code. How about the blogger platform? Please advise.


Hello Istiak,
Can you show how to add this in wordpress blog?


Just tried to do this and now my site won’t even load it says Parse error: syntax error, unexpected T_STRING in /hermes/bosweb/web107/b1076/ipg.bakingbeautynet/wp-content/themes/prose/functions.php on line 77

any advice? 🙁

    Istiak Rayhan

    These codes are for Thesis theme. I think you dont use Thesis.
    Delete the code you added on your functions.php file. Your site will load like it used to be. Thanks. Keep in touch.


Hi, i feel that i noticed you visited my weblog thus i got here to return the want?
.I am trying to in finding things to improve my site!I guess its good
enough to make use of some of your concepts!!


Thnx for the suggestion Istiak…
Can you please tell me how did you place the 728×90 banner at the header..?
I am sorry for the nooby questions..m actually new to adsense and very curious..
Whats better than taking an advice from a pro.. 🙂

    Istiak Rayhan

    It's ok mate. I am always there when people need me. 🙂
    It's pretty simple. on your custom_functions.php file add this (Backup your file before editing them.) :

    function header_banner() { ?>
    <div id="header_banner">
    *Your adsense code*
    <?php }
    add_action('thesis_hook_header', 'header_banner');

    Then add this on custom.css file :

    /*Adding HEADER ADSENSE */
    .custom #header_banner { float:left; position:absolute; width:728px; height:90px; top:17px;
    margin-left: 12em; }

    That's it. You are done.


Hey..I just figured this..Can you help me how to align the add more towards left rather than the center ?