How To Insert Adsense And Code Snippet To WordPress Genesis Themes


I am a big fan of the Genesis Framework because it the best WordPress theme framework. you can build amazing website using their themes or build your own WordPress theme using their rock-solid framework.

If your WordPress website is powered by Genesis, you might find it daunting conveniently placing Google Adsense and other AD networks codes in your Genesis powered WordPress website.
Many resort to using Ads plugins like Quick Adsense, AdSense Now! and the likes. but they all have their limitations because there are some section of your WordPress blog you will like to place Ads but you cannot using those plugins.

Let me show you how to insert Adsense Ads codes or any code you want to run in different area of your Genesis powered website using the Genesis Simple Hooks plugin.
Mind you, the Genesis framework have 50+ action hooks where code snippet can be injected into any Genesis theme. Instead of the sometimes tedious and unfamiliar process of creating functions in your theme files, this plugin gives you an attractive, easy to use interface for modifying your Genesis theme via the hook system accepting HTML, shortcode, and PHP.

Inserting Code snippet To Genesis Theme Framwork

Say you want to place Google Adsense codes and other code snippet in various area of your Genesis theme powered WordPress website, follow the few steps below to learn how to achieve this.

  • Install the Genesis Simple Hooks plugin and go to its settings page by clicking Simple Hooks under Genesis tab
    Genesis Simple Hook
  • On the Simple Hook page, you will see 50+ hooks and a textarea you can inject your own code.
    Assume we want to add a Google Adsense Ads below every post title, goto the genesis_after_post_title Hook and input your Adsense code in it. genesis after post title Hook
  • Save settings and preview your site.

If you want to insert a PHP code snippet to any hook, make sure the Execute PHP on this hook? is checked.

To place Adsense Ads in other sections or area of your blog, you need to know the right hook to place the Ad code. below are some hooks and their description to aid your Adsense ads placement.

  • genesis_before_content_sidebar_wrap – This hook executes immediately before the div block that wraps the content and the primary sidebar. you can insert an Adsense Leaderboard Ad unit here
  • genesis_before_post_content – This hook executes before each post and page content. you can insert a mobile banner; medium and large rectangle Ad unit.
  • genesis_after_post_content Hook – This hook executes after each post and page content. you can also insert a mobile banner; medium and large rectangle Ad unit.
  • genesis_before_post_title Hook – This hook executes immediately before each post/page title. mind you, code placed here will also be outputted when your site front page or home is display. adding Adsense here, you need to restrict it from displaying on front page or home. in order for it not to stop other adsense ads from displaying on the home page as Adsense only support 3 ad unit per page.
  • genesis_after_post_title Hook This hook executes immediately after each post/page title. also heed to the precaution above in “genesis_before_post_title” Hook

Visit the StudioPress Hook Reference page for list of hooks and their descriptions.

To Add Google Adsense skyscraper to your WordPress blog, you will have to use the Text Widget. drag a Text Widget to your primary or/and secondary sidebar and insert your Adsense code into it and save.

To easily identify Genesis Hooks, i advice you install and activate Genesis Hooks. it automatically displays Genesis structural hook names in the browser for all pages.
Genesis Structure Hook display

Grab a copy of Genesis Framework get the best WordPress experience.

If you have any question or a contribution to make, please use the comment form below. i will love to hear from you.


About Agbonghama Collins

Agbonghama Collins is a webdeveloper and an internet geek. I love writing and sharing the little idea & information i know. Hope you enjoyed my Article.

Follow me on Twitter, add him on Facebook or on Google+

  • Pritam

    Great post , I was just searching for the same..Thanks
    I will be using this soon now :)

  • Jacob Godspower

    Thanks for the information i was really having problem insert the code before i saw this post which help me to solve it thanks for the Great post dude.