Over the last few days, you must have seen a slew of posts on Techarraz on the Hybrid Theme. Hybrid Theme is extremely customizable, and the availability of child themes makes it full of options, when it comes to the blog layout. However, there are some common tweaks that apply to all themes, like showing adsense advertisements below post titles, using AIO SEO Pack with Hybrid and removing duplicate meta tags, replacing posts with excerpts on homepage and likewise. Today, a new trick gets added to the list as we will see how to add link-ad units under the menu.
What are link ad units, and where should they be placed ideally?
Link ad units are like a list of links. They do not have any descriptive text, byline or images. All they have is one or two words, and they are available in vertical and horizontal layouts. As you can see in the image below, I have marked the link ad unit.

How to Insert Link ads under Menu on Hybrid Theme?
To insert link ads under the menu, we have to know where in the code the menu comes into the picture. Let us start with the header.php present in the Hybrid directory (not in the child theme). In header.php, you will see an opening div tag with an id of “container”. If you have worked in web-development for long enough, you might have noticed how this id is used for the content area, below the header. So, everything prior to this is our header.
Right before this div tag, we can place our link ad code. I have used the same css for the link ad, as found on the menu. The color of the link unit should also match the color of the menu bar. Enclose your adsense code between div tags and finally, your code should look like this.
</div><!– #header-container –>
<?php do_atomic( ‘after_header’ ); // hybrid_after_header ?>
<div align=”center” id=”primary-menu” class=”menu-container”>
<script type=”text/javascript”><!–
google_ad_client = “ca-pub-6740844476322233″;
/* Link_ad-Under-Navigation */
google_ad_slot = “5116863245″;
google_ad_width = 728;
google_ad_height = 15;
//–>
</script>
<script type=”text/javascript”
src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>
</script>
</div>
<div id=”container”>
That is all you need to do to display ads below the menu, on the Hybrid Theme. Do not copy the code given in this example as it is. Replace the link unit code with your own adsense link unit.
Chinmoy Kanjilal is the geek behind Techarraz. This is where he rants about his adventures with technology. Get to know him better, and connect with him on social networks.
Recent reactions