Integrating the new BuySellAds code into Thematic

The old code snip­pet from BuySellAds.com didn’t require to change any­thing in the code of a site/blog; only to be copy­pas­ted into a text wid­get was the deal. The new code is much bet­ter as it is not block­ing the rest of the page while it’s load­ing, but you have to put a code snip­pet right after the open­ing <body> tag on all pages. In Them­atic, this can be eas­ily accom­plished without any plu­gins or theme file hacks, just paste this into the functions.php of your child theme:
[cc lang=“php”]
<?php
func­tion bsa_before() { ?>




<?php }

add_action(‘thematic_before’, ‘bsa_before’);
?>
[/cc]

Then you can put the actual ad slot code from the ‘Get ad code’ page into a text wid­get in your side­bar, or any other place as you wish.

This entry was posted in Uncategorized. Bookmark the permalink. Both comments and trackbacks are currently closed.

2 Comments

  1. Posted March 9, 2010 at 12:09 | Permalink

    Simple but very use­ful! Thanks Eugen.

    • Eugen R. 535
      Posted March 9, 2010 at 17:14 | Permalink

      You’re wel­come!