Lets be honest, most sites are designed to provide some form of advertising or income. After all the internet is basically the market of the 21st century, most everyone has some type of income tied directly to it. So what good is a WordPress theme that is not completely compatible with advertisements like Google Adsense?
Some themes come with pre-configured support for advertisements and related options, but for those few that don’t provide ad support, this tutorial will explain how to implement the features.
What the term “pre-configured theme” means is that the related theme basically allows “easy” placement and editing options without any advanced editing requirement. The real truth however is that every theme could potentially become ad compatible.
First however, you will need to decide what size space you are working with and how big you would like the ad to appear on your page. The more conventional ad sizes are listed below, but you could realistically alter the ad to fit any size space.
- Horizontal Banner: (468×60)
- Leaderboard: (728×90)
- Perfect Square: (250×250)
- Vertical Banner: (120×600)
- Skyscraper: (160×600)
- Rectangle: (300×250)
- Large Rectangle: (336×280)
Direct Source File Editing (Manual) Method
In order to manually insert ads into your website, you will have to directly enter code into each section of your page where you would like the ads displayed.
If you aren’t already aware, each page is broken up into various sections which consist of the following: the header (top), the sidebar, the site index (page listing), the posts, and the page template (static page section which appears on every page).
To manually add the Google Adsense ads onto your site the source “page.php” file will need to be edited. This will ensure the ads display on all available pages within the site, eliminating the need to manually add the code to every single page individually.
First, you will have to sign into your Google AdSense account and create a new ad unit. Then after editing the ad options and saving the ad you must copy the entire advertisement code to the clipboard in order to continue.
Insert the code you copied into the file which indicates the location you want the ad to show. For instance, if you want the ad to appear in the header of your page then you would insert the code into the “header.php”. Make sure not to break up previous html commands, meaning input the code on a fresh line outside of any previous command tags.
Adding Google AdSense Through A WordPress Widget
Google AdSense ads can also be added to a WordPress blog or site through the use of text widgets. Instead of manually editing code and changing the theme source files users can add AdSense code via the “Appearance > Widgets” WordPress Dash-board menu.
To begin, simply drag a “text” box widget into the column on the right hand side of the screen (after choosing where you would like the advertisement to display of course; header, body etc.). Click on the right side of the “text” widget box, the arrow should drop down and display a menu. Copy your ENTIRE Google AdSense code (after creating a new ad unit) and paste it into menu below the “text” widget.
When finished select the “save” button displayed below the “text widget, this will obviously save any changes which have been made to the theme and activate them. The maximum number of Google AdSense ads per page is 3, so remember this when adding additional “text” widgets in the future.
That’s it, all done! But there’s one more step to adding Google AdSense ads.