In this brief wordpress tutorial I`m going to cover creating a shortcode for banner insertion in your posts. This is a great solution, especially if you don`t want banners shown on all of your posts, or you want to place the banners in accordance to the articles/text of your blog post. If you`re not familiar with the wordpress shortcode api you can visit the wordpress codex, the guys there got it covered perfectly. The code below is designed for Google Adsense, but can easily be adjusted for any type of affiliate programs.
In order to use the code paste it at the bottom of your theme`s functions.php file right before the closing php tag.
After you save your functions.php file, you`re ready to test your shortcode. Open some post, or add a new one and paste [adsense] somewhere in the post. After you save it, you`ll see your banner showing in the exact same place, where you placed your shortcode.