Unlike other WordPress themes, getting certain things done on Genesis can be challenging especially if you’re not used to how it works. The post I previously wrote on how to add Google Adsense to WordPress themes without a plugin doesn’t work on genesis if you’ve noticed. If you need to include Google ads below your header right after the menu in your Genesis theme without an adsense plugin, you can’t possibly do that by editing your header.php as in other themes.
I recently had to work with a client who insisted having ads below the menu and at first, I had no idea how to accomplish that (since I’ve never added any code in that position before) till I did a little tweaking here and there.
Now, this doesn’t work just for Adsense alone, you can also insert your affiliate banner in this position. It’s been said that ads placed in this position gives a higher CTR but I haven’t confirmed this since I don’t use ads in that position as you can see.
To insert your adsense code, affiliate banner or any custom link under your header, follow these easy steps:
- Download and install Simple Genesis Hooks
- Go to Genesis > Simple Hooks
- Scroll down till you get to the content section
- In the box labelled
genesis_before_content_sidebar_wrap Hook, paste this code:
YOUR ADSENSE CODE, AFFILIATE LINK OR BANNER HERE
- Replace YOUR ADSENSE CODE, AFFILIATE LINK OR BANNER HERE with the adsense code you want here. It could be link unit or leaderboard.
You can also insert your affiliate link or banner in this position.
Note: You can change background: #ffffff to your own background color. The default background color in the code is white but you can change the code to black or whatever you want.
Like I mentioned already, this only applies to Genesis Child themes. If you’re using some other theme besides Genesis and Thesis, you should check this post instead.