Jump to content
Sign in to follow this  
michaelmiles

Adding Adverts between blog posts

Recommended Posts

michaelmiles    0
michaelmiles

I'd like to be able to have an advert placed between the 3rd and 4th post on my blog. How would you go about doing this? As an example, uncrate.com home page (blog). Notice the adverts placed between blog posts as you scroll down.

Share this post


Link to post
Share on other sites
Andrew    201
Andrew

this is tough.. have you looked for a plugin?

Share this post


Link to post
Share on other sites
jnoh    0
jnoh

Hey Michael this looks great. We're going to want to do this in the 'library/_posts.php' file. You should be able to follow those directions exactly. Let me know if you get stuck or if you need help with it.

Share this post


Link to post
Share on other sites
michaelmiles    0
michaelmiles

Done! Screen Shot in action For reference, I inserted the <?php $count = 1; ?> before this line: <?php if (have_posts()) : while (have_posts()) : the_post(); ?> And then the advert code (currently, still testing out best position) before this line (and after the </div> that closes the post): <?php if(is_single()):?>

Share this post


Link to post
Share on other sites
jnoh    0
jnoh

That looks great! I'm glad you got it working.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×