Technical Thursday: Manually Inserting Ads into Your Wordpress Theme
Getting ads into your blog is the most important aspect of monetizing your blog. There are countless plugins that attempt to make it easier for you to place your ads into your content. While most of them work, a lot of them don’t do exactly what you want. So, what’s the solution Place your ads yourself directly into your theme’s template files.
Don’t worry, it’s actually not that difficult.
Wordpress Template Ad Placement
If you want to place ads at the beginning or the end your blog posts, it’s pretty simple. Log into your Wordpress Admin and go into the theme editor. You’ll need to select the ’single.php’ file.
Place Ad at the top of a Wordpress Post
Look for this line of code that contains the following:
To display your ad above every post simply paste your ad code above the “content” php tag. The result will be something like this:
<?php the_content; ?>
Place Ad at the bottom of every Wordpress Post
Look for the same line of code:
Then paste your adsense code below the “content” tag. The result will look similar to this:
<Your Google Adsense Code Here>
This will put an ad module below all your posts.
Bear in mind that many Wordpress themes are different and may have their PHP tags laid out differently. The trick it so play around with your placing to make sure everything is displaying correctly. You most likely won’t get it right the first time.
Place Ad in a Wordpress Sidebar Widget
This is by far the easiest way to place an ad on your Wordpress blog. All you need to do is create a plain text sidebar widget in your widget settings control panel. Simply place your adsense code and save it. Wordpress will do the rest.
If you’re feeling brave, you can also manually edit the ’sidebar.php’ file to place your ads that way.
Related Posts
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.






Love your site! Your content here is top notch, I’m def going to go through you entire site. I came here looking for a post about hosting multiple domains on on GoDaddy hosting plan. I don’t know if you fave a post here or not on it. I can’t seem to get my additional WordPress sites to work properly without having a domain name like http:surferjerry.com/wordpress
I emailed GoDaddy and they showed me how to redirect the domain name but that only helped it to load the 1st page all the others wouldn’t load and wp-admin wouldn’t work either. If you know how to set these multiple domain names up on the same hosting plan with just the .com at the end would you please do a post on it? I have been searching Google and just cant figure it out. Thanks