Jump to content


Photo
- - - - -

Adding Adverts between blog posts


This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1 michaelmiles

michaelmiles

    Advanced Member

  • Members
  • PipPipPip
  • 45 posts

Posted 25 February 2010 - 04:27 PM

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.

#2 arpowers

arpowers

    Founder

  • Administrators
  • 3270 posts

Posted 25 February 2010 - 10:25 PM

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

#3 michaelmiles

michaelmiles

    Advanced Member

  • Members
  • PipPipPip
  • 45 posts

Posted 26 February 2010 - 09:37 PM

I haven't found a plugin yet. I found a plugin to do everything BUT! I did find this info for editing the template: http://www.lancelhof...-between-posts/ Can you take a gander and inform if that is a good idea? I don't want to dealve into the code just yet, but no biggie if I have too.

#4 jnoh

jnoh

    Advocate

  • Members
  • PipPipPipPipPip
  • 502 posts

Posted 27 February 2010 - 03:48 AM

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.

#5 michaelmiles

michaelmiles

    Advanced Member

  • Members
  • PipPipPip
  • 45 posts

Posted 28 February 2010 - 12:17 PM

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()):?>

#6 jnoh

jnoh

    Advocate

  • Members
  • PipPipPipPipPip
  • 502 posts

Posted 02 March 2010 - 03:42 AM

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