Title: How do I insert an ad between posts?
Last modified: August 18, 2016

---

# How do I insert an ad between posts?

 *  [wmeredith](https://wordpress.org/support/users/wmeredith/)
 * (@wmeredith)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/how-do-i-insert-an-ad-between-posts/)
 * I want to have my home page alwasy display and ad between the 4th and 5th posts.
   How should I go about implementing this?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [tonywright](https://wordpress.org/support/users/tonywright/)
 * (@tonywright)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/how-do-i-insert-an-ad-between-posts/#post-420281)
 * first you say hello. then you implement politeness, share your web address, and
   say thank you. then we reply.
 *  [davidchait](https://wordpress.org/support/users/davidchait/)
 * (@davidchait)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/how-do-i-insert-an-ad-between-posts/#post-420290)
 * I’m happy to help, no introduction needed. 😉
 * You can use something like CG-Inbetween to help you — basically you insert one
   line into your index or archive template, and then from the admin panel can create
   an ‘Inbetween’ set for after the fourth post. I generally recommend people use
   the ‘file include’ Inbetween type, as you can then include whatever HTML file/
   code you might want. Makes things easy.
 * You can also do it ‘by hand’ if you have some PHP experience. Set a counter at
   the top of the posts loop, increment at the end of the loop, and when it equals
   4 you echo out your ad code. But CG-Inbetween basically does that for you with
   one line added to your template, and allows you to create different Inbetweens
   with different offsets (say one at 4, one at 8, and one always after the Last
   post on a page).
 * -d
 *  [Rok](https://wordpress.org/support/users/rok/)
 * (@rok)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/how-do-i-insert-an-ad-between-posts/#post-420417)
 * In addition to David’s reply -you can also check as an alternate: [http://www.tamba2.org.uk/wordpress/adsense/](http://www.tamba2.org.uk/wordpress/adsense/)
 *  [davidchait](https://wordpress.org/support/users/davidchait/)
 * (@davidchait)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/how-do-i-insert-an-ad-between-posts/#post-420426)
 * Yeah, as I said, you can do it ‘by hand’ — that’s what that link shows how to
   do. CG-Inbetween does the complex stuff for you, and you only need to insert 
   one line (well, per template file — simple themes might have one file, complex
   ones might have a few) of php code.
 * Additionally, the problem with any case of editing php files is trying to tell
   people ‘where to put code’. Themes have completely differing code layout.
 * In the future, I’m hoping to have CG-Inbetween ‘automatically hook’ into the 
   posts loop. It won’t be guaranteed, and might not work properly if folks use 
   custom queries.
 * Unfortunately, WP needs some additional template tags/hooks that ALL theme designs
   follow in order to enable this stuff to happen without user editing of the theme
   files… We’re pushing for some of those changes.
 * -d

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘How do I insert an ad between posts?’ is closed to new replies.

## Tags

 * [layout](https://wordpress.org/support/topic-tag/layout/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 4 participants
 * Last reply from: [davidchait](https://wordpress.org/support/users/davidchait/)
 * Last activity: [19 years, 10 months ago](https://wordpress.org/support/topic/how-do-i-insert-an-ad-between-posts/#post-420426)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
