Hi guys,
I need a little help with some PHP and wordpress. I am trying to put an ad unit in between posts 1+2 and 2+3 on the homepage.
I can manage to put it in between posts 1+2 or 2+3 using the following code:
?php $count = 0 ?
then the if have posts, show posts business.
?php if ( $count == 0 ) : ?
ADSENSE/advertiser code
?php endif // $count == 0?
?php $count++ ?
?php endwhile; else: ?
This will put it in between posts 1+2 and changing
?php if ( $count == 0 ) : ? to
?php if ( $count == 1 ) : ? will make it appear between posts 2+3
But if you try and run both at the same time, they will both appear together (e.g two units between 1+2 or two units between 2+3). Is it possible to get it to appear between 1+2 and 2+3?? Any help would be great.
I need a little help with some PHP and wordpress. I am trying to put an ad unit in between posts 1+2 and 2+3 on the homepage.
I can manage to put it in between posts 1+2 or 2+3 using the following code:
?php $count = 0 ?
then the if have posts, show posts business.
?php if ( $count == 0 ) : ?
ADSENSE/advertiser code
?php endif // $count == 0?
?php $count++ ?
?php endwhile; else: ?
This will put it in between posts 1+2 and changing
?php if ( $count == 0 ) : ? to
?php if ( $count == 1 ) : ? will make it appear between posts 2+3
But if you try and run both at the same time, they will both appear together (e.g two units between 1+2 or two units between 2+3). Is it possible to get it to appear between 1+2 and 2+3?? Any help would be great.