Line 33 of topic.php has the for loop that goes through all the posts.
Insert your code there
@ kevinjohngallagher
Hey dude you are genius.My problem is solved.
But just a small doubt-I made a counter (initial value=0) which will count number of posts in foreach loop (Line 33 of topic.php),if counter is equal to 4 – code for ads – reset counter to 0,else increment counter by 1.This works.Ads are displayed after every 4 posts.But only first two ads are visible rest of the ads are invisible i.e a white space is felt at the place of ads after second ad.
I just want to ask u,is there any policy of google which doesn’t allow to put ads in a loop or doesn’t allow to display same ad repeatedly on a page ? Any idea about this ?
<blockequote>
you are genius
Ha, thanks alot, but i can’t tell you how wrong that is
I’ve no idea about Google Ad’s i’m afraid.
Initially, I’d output a div with a border on it to make sure your code is working spot on, and then take it from there
Thank you kevinjohngallagher..
as far as I know google only allow 3 ad units per page, not sure about link units.
If you are displaying a goodle ad in your header, sidebar or anywhere else, this is probably the reason only 2 are displaying in the loop.
Hi, would you please give me the code to count post and displays your ad ?
Thank you very much