Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Google Adsense

Hi Null, to do that you need to change your template a bit and create a new hook, which is dead easy, and a testament to the flexibility of the event model that underpins both WP&bb.

  1. Copy topic.php from bb-templates into my-templates (you may need to create this folder).
  2. Find the for loop near line 29 – it will read something like this: <?php foreach ($posts as $bb_post) : $del_class = post_del_class(); ?>
  3. Immediately before it (outside the loop, but inside the <?php) add the line $need_to_show_ad=true;
  4. Then change the line <?php bb_post_template(); ?> to read <?php bb_post_template(); if ($need_to_show_ad) { do_action('showadvert'); $need_to_show_ad=false; } ?>
  5. Finally, change the action in the plugin so it fires on your newly created hook add_action('showadvert', array('bb_adsense','wide_advert'));

… and an admin page? Maybe when bbPress matures!

Skip to toolbar