• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WBXPress.NET

Website Developement Guide

  • apache2
  • nginx
  • mysql
  • php7
  • SSL
  • wordpress
  • genesis
  • caching
  • seo

Add Adsense in between Posts of Genesis Home Page

Updated on 2nd August 2015 Leave a Comment

Adding Google Adsense Code in Genesis theme is very easy by using Simple Hook Plugin. Using this plugin one can insert adsense almost anywhere e.g. before or after of header, footer, post title, post content, post info, comment-box, sidebar etc.

But what if you wish to add adsense in home page in between posts, for example, after each second post or third post. Simple hook plugin can not solve this.

You need to create a widget area by editing your theme’s functions.php

Add the following code inside functions.php

You need to also add the following code in style.css for styling purpose

.wbxp-google-ads {
	text-align: center;
	margin-top: 20px;
	margin-bottom: 20px;
}

Now you should see a widget in your theme Appearance->Widgets

between-post-area-widget

Add a Text Box in this widget and paste your Google Adsense code inside it. Now you should see adsense displayed in your home page after each second post. If you wish to add adsense after each third post, just change the value to 3

$loop_counter == 3

Filed Under: google, wordpress Tagged With: adsense, genesis

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Most Popular Posts

  • Remove/ Defer Render-blocking JavaScripts
  • Customizing Genesis eleven40-pro Theme
  • Free Genesis Child Theme by WBXPress
  • Host Multiple Sites with SSL in Ubuntu 18.04
  • 25 Ways to Boost Website Traffic that Really Work

Recent Comments

  • Ruhul on Customizing Genesis eleven40-pro Theme
  • Priya Agarwal on Customizing Genesis eleven40-pro Theme
  • mimi roy on Remove/ Defer Render-blocking JavaScripts
  • danish choudhary on Customizing Genesis eleven40-pro Theme
  • Radhe on Customizing Genesis eleven40-pro Theme

Copyright © 2021 · Powered by WordPress · Log in