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

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

Add Widget After Post In Loop

This code enables you to add a new widget area after the 1st post on the home page archive.

This is a popular spot to add Adsense code and affiliate advertising banners as it displays in the same position after new posts are published.

Adsense code also works great in text widgets and its better to add HTML in a widget rather than hard code it into a custom file or template file.

after-1st-post

The code is easy to customise so you can use on any other type of archive simply by changing the conditional tag.

If you want to add the widget after the 2nd or 3rd post, you can, simply by modifying a single number in the code. Its as easy as that.

Here’s the PHP code you simply copy and paste into your child theme functions file.

Register for full access

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.