If you would like to add Google AdSense advertisements to your genesis framework theme, here is the method I use. These instructions assume your genesis child theme is using html5. If you are not using an html5 child theme, the code below will need to be modified slightly.

1. Add the following 2 code sections to your genesis child theme functions.php

Register 2 new widget areas

[sourcecode language=“php”]genesis_register_sidebar( array( ‘id’ => ‘wpselect_before_post_content’, ’name’ => __( ‘Before Post Content’, ‘genesis’ ), ‘description’ => __( ‘Displays on single posts before post content.’, ‘genesis’ ), ) ); genesis_register_sidebar( array( ‘id’ => ‘wpselect_after_post_content’, ’name’ => __( ‘After Post Content’, ‘genesis’ ), ‘description’ => __( ‘Displays on single posts after post content.’, ‘genesis’ ), ) );[/sourcecode]

Insert new widget areas into single posts

[sourcecode language=“php”]add_action( ‘genesis_before_entry_content’, ‘wpselect_before_post_content’ ); function wpselect_before_post_content() { if ( is_single() ) { genesis_widget_area( ‘wpselect_before_post_content’, array( ‘before’ => ‘’, ) ); } } add_action( ‘genesis_after_entry_content’, ‘wpselect_after_post_content’, 1 ); function wpselect_after_post_content() { if ( is_single() ) { genesis_widget_area( ‘wpselect_after_post_content’, array( ‘before’ => ‘’, ) ); } }[/sourcecode]

2 Add the following code to your genesis child theme style.css

[sourcecode language=“css”].wpselect_before_post_content .widget { float: left; padding-bottom: 10px; padding-bottom: 1rem; padding-right: 24px; padding-right: 2.4rem; } .content-sidebar .wpselect_before_post_content .widget, .content-sidebar-sidebar .wpselect_before_post_content .widget { float: right; padding-left: 24px; padding-left: 2.4rem; padding-right: 0px; padding-right: 0rem; } .wpselect_after_post_content .widget { clear: both; margin-bottom: 26px; margin-bottom: 2.6rem; margin-top: 26px; margin-top: 2.6rem; text-align: center; }[/sourcecode] The css listed above may need to be tweaked depending on your genesis child theme css. The css above places the adsense ads as recommended in the google adsense help document for blog articles. The sidebar ad can be placed in your primary sidebar.

3. Add google adsense code to text widgets

Genesis AdSense Widget Your theme will now have 2 additional widget ares under Appearance > Widgets. The widget areas are titled Before Post Content and After Post Content. You need to drag a text box widget into each of these widget areas and place the appropriate google adsense code into each text box. I hope these instructions help you to add adsense advertisements into your genesis framework theme.