How to add an Adsense Ad after every post in StudioPress Genesis

Google’s Adsense Ads are a great way to earn money from your site’s traffic. Just add this WordPress Code Snippet to the functions.php file in your current WordPress theme in order to add an Adsense Ad after every post in a site running on the StudioPress Genesis Framework.

 * Add Adsense Ad after posts in StudioPress Genesis
 * @author
 * @link
function ad_after_posts() {
 if ( is_single() ) {
<strong>Sponsored Links</strong>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-5636129889821632";
/* WPSnacks_After_Post_Ad */
google_ad_slot = "2107218414";
google_ad_width = 468;
google_ad_height = 60;
<script type="text/javascript"
add_action('genesis_after_post_content', 'ad_after_posts');

Just be sure to replace my Adsense Ad code(between the first and last “script” tags) above with your own. In the example above, the section is headed with “Sponsored Links”, which can be changed to what you would like the heading text above your Ad, just be sure you follow Google’s Adsense Guidelines.

   Related Sponsored Links

Disclaimer: The information contained in this website is for general information purposes only and in no event will this site or its owners be liable for any losses or damages associated with your use of our site or content. Click here to see our full Disclaimer.


  1. The more simpler way will be to use some plugin. Post layout plugin does the task easy, and it has many more features.

  2. Emily Murray says:

    This is great thanks! Is there any way to exclude specific categories or posts that you do not want ads displayed on?

Leave a Comment