Archived

This topic is now archived and is closed to further replies.

  • 0

Placing adsense ads after the 1st and 4th post on the front page

Question

Posted · Report post

Website URL: http://www.whatsthatbug.com

Framework Version: 2.4

WordPress Version: 3.5.1

 

I want to show an adsense ad after the 1st and 4th post on the main page. I tried doing it in child_functions.php like this:

$x++; if ($x == 1) { 
  add_action('pagelines_loop_after_post_content', 'google_lc_ad'); 
} 

But that didn't work - it still shows after *every* post. Any suggestions on how/where I can accomplish this?

 

Thanks!

Share this post


Link to post
Share on other sites

3 answers to this question

Posted · Report post

Thank you! I did not search as well as I had thought. That worked perfectly (with a change to the math).

Share this post


Link to post
Share on other sites

Posted · Report post

No worries, glad it worked :-)

Share this post


Link to post
Share on other sites