hoystory 0 Report post Posted May 24, 2011 I managed to do this once by directly editing the postloop.php file, but it's a huge pain/re-learning experience for me to go in and hard code that file every time there's an update to PlatformPro. So, this time I tried using the hooks for the first time. I made the following changes to the functions.php file in the Platform Base theme: add_action('pagelines_loop_post_end', 'inline_amazon_ad'); function inline_amazon_ad(){ if(!$show_ads){ ?> HTML AD CODE HERE <?php $show_ads = 1; } ?> Problem: Now the ad appears after each and every post. Can anyone tell me what I can do to make this so the ad only appears after the first post (or the second?)? Is this even possible using the hooks? While my understanding of all this is obviously rudimentary, I'm afraid that by using the hook, I'm placing the code in the loop and where I can't do any counting to limit placing the ad only once. Any help would be much appreciated. Matt Share this post Link to post Share on other sites
Simon 248 Report post Posted May 24, 2011 try globaling the variable: (not tested but worth a shot) `add_action('pagelines_loop_post_end', 'inline_amazon_ad');` `function inline_amazon_ad(){` `global $show_ads;` `if(!$show_ads){ ?>` `HTML AD CODE HERE` `<?php $show_ads = 1; } ?>` Share this post Link to post Share on other sites