How can I insert ads between posts in latest articles?
I have already done so in categories and archives with these instructions: https://forum.tagdiv.com/topic/how-to-insert-ads-between-posts-on-the-main-categories-and-in-the-archives/
and would like replicate that between latest articles on the homepage.
Thank you.
Hi,
Please add this function is_home() like this in loop.php file: http://screencast.com/t/YFkhYo7wvH3 This will add the custom ad 1 between latest articles post on homepage also.
Thanks
Hi,
I’d like to add to this question and see if there’s a way to change the code to display a different ad for $adcounter == 2 and $adcounter == 4 instead of using the same ad code. I’d like to display adsense on one and a different ad company on the other
Hi,
You can create another condition which in case $adcounter == 4 renders another ad code, like this: http://screencast.com/t/B8otqml0YEZ
result: http://screencast.com/t/9dBOF9aqLxM
Here is the code I’ve used: http://pastebin.com/ip5PkTZF
Thanks
Hi,
Please follow this topic to see how to adapt the code to modules as well: https://forum.tagdiv.com/topic/how-to-insert-ads-between-posts-on-the-main-categories-and-in-the-archives/
Thanks.