How to Place Google AdSense Ads in a WordPress Theme
1. How to Place Google AdSense Ads in a WordPress Theme
This article is all about placing Google AdSense Ads within a WordPress theme. Though to
begin with you need to make sure you are actually using the right theme! You shouldn't
work around a theme, but instead be able to work with a theme.
So if you need a WordPress theme designed just for you, else help modifying an off the
shelf theme, you should hire our Hull web designers, to help you. Our team of theme
designers at Neogain can help you, so please contact us to dicuss your requirements.
There are many ways you can place Google AdSense into a WordPress theme. We will tell
you about how to place the adverts, plus suggested locations in a theme.
Tip – Don't use a WordPress plugin to place adverts within your theme.
There are numerous plugins that can help increase functionality, but there really is no need
to use a plugin if you intend to run a set of adverts for a long period of time. Otherwise you
are just adding another plugin without reason, which means additional code, and possibly
an issue when upgrading your WordPress blog.
Tip – Use simple html code to align your advert.
All you need to do is to use the 'editor' within the WordPress dashboard, when you are
logged in as an administrator to place the code. This means you can easily place adverts
within your template.
Example code
Google Adsense Link Unit in the header area, would be placed in the header.php code.
<div style="width:828px; margin:0 auto; text-align: center; border-top:10px; border-
bottom:2px; ">Google code</div>
A Google Display advert in a blog post, would be placed in the single.php code.
<div id="theadcode" style="float: right;">Google code</div>
If you were placing Adverts on a page it would be in the page.php code. If in the sidebar
you would place a div container with the advert code in a text widget.
Tip – Use multiple Google AdSense advertisements within your Template.
Having just one advert on a page is a missed opportunity. If you have an article at the top,
but someone reads the whole page, you are then missing a potential click at the bottom,
and vice versa. Also there are different types of adverts, covering: text, graphical, size and
style.
It is worth utilising the different areas of a WordPress theme to place adverts. For instance
an AdSense link unit under the heading, one display adverts at the top of a post, another in
the sidebar and a third at the bottom, means you've got all the areas covered.
There is a limit on the amount of adverts you can use, which you should always check the
2. current limits. However I believe you can currently use three link units, with three other
adverts such as two display adverts and one text advert.
However adverts can not only perform differently based on the type of advert and position,
but also the theme being used and the content itself.
Tip – Adjust the Text Advert Colours to match your website colours.
It has been noted by some that they gain higher results, if the colours of the text within a
colour advert matches the colour of the text of their website content.
If you require WordPress support, please get in touch.