It is easy to add advertisements to sidebars and footer for not so advanced WordPress or Genesis users, but when it comes to adding them to custom areas in your theme, it might be a little tricky. If you are using Genesis framework by StudioPress and you want to add advertisements codes in different parts or your theme, then this tutorial is going to help you in the process. Whether you want to use adsense ads on your Genesis site or any other ads, this tutorial will work for all.
I have written more tutorials about Genesis framework which includes registering custom widget area. I will be using the same method to register custom widgets for advertisements in Genesis Framework.
How to add Custom Widgets for Advertisements in Genesis Framework
1. Adding Custom Widget Area for Advertisements Above Post Title
Add the following code to your Genesis child theme’s functions.php file.
1. Adding Custom Widget Area for Advertisements Below Post Title
Add the following code to your Genesis child theme’s functions.php file.
3. Adding Custom Widget Area for Advertisements After Post Content
Add the following code to your Genesis child theme’s functions.php file.
4. Adding Custom Widget Area for Advertisements After Comments
Add the following code to your Genesis child theme’s functions.php file.
After you have added the required codes to your child theme’s functions.php file. You will see the new widget areas in Appearance > Widgets. In case you are using adsense, you just need to copy the code from your adsense dashboard and paste it into the text widget in the widget areas we registered earlier.
I have included only main widget areas which are utilized by most of the sites, if you yourself want to test out the new widget areas refer to Genesis hooks. Feel free to ask any questions regarding this tutorials.
Thanks sachin
Very useful for newbie like me