Placing Banner (AdSense) Ad Next to Site Title in WordPress Header
A very common problem is adding an ad unit to your WordPress blog which displays in-line with your site title. Here is the simple way of doing it:
- Open WordPress Editor
- Open the header.php file
- In this file – look for the following code <header id=”masthead” role=”banner”>
- Make the following change to the hgroup tag
<hgroup style=”display:inline-block”>
<h1 class=”site-title”><a href=”http://mysite.com/” title=”Site Title” rel=”home”>Site Title</a></h1>
<h2 class=”site-description”>All about Jobs and Salaries</h2>
</hgroup>
- Immediately below the hgroup tag, add the Ad (Google AdSense) Code inside a span block as shown below:
<span style=”float:right”>
<!– Paste Ad Sense Code below–>
</span>
- Save the file
Viola – you have successfully added a banner ad to your WordPress header inline with the site title and header.
Note: For this to be visually effective, your site’s title and description should be small.
Let us know if you found this tip useful in the comments section below.
If you think that you have a link that adds value to this article please contact us at techie[at]techzog[dot]com for evaluation of inclusion into the article.
Comments left solely for spamming links will be deleted. Thank you for understanding.