Monday, November 28, 2011

test

In this post i will show you how to embed AdSense ads in your blogger posts you can either have them at the top or bottom of your posts or both but remember you are only allowed a certain amount of ads on your blog so first I recommend that you download a backup copy of your template as i will not be held responsible if you mess your layout up

now if you check the box on the post widget you will see that it is a simple way to add AdSense to your blog posts



by default they are displayed at the bottom of your posts but what if we want them at the top below the post title ? or both well lets take a look at the code which is used to add the AdSense ads to the posts


go to Layout > Edit HTML check the check box to expand the widget templates and scroll down until you find the code shown in the screenshot below



once you have found the code cut it to Notepad or a simple text editor. Now we need to decide which ads we are going to use so for this tutorial I'm going to be using the 300px x 250px rectangle ad

note the width and height of your ads because we are going to wrap the code inside a simple div with inline styles so you can either type the code in or just copy the code below










make sure your code looks like mine given above and set the width and height to the ad size you are using now to get the ads just below the post title find the following line of code in your template




paste it just above there like i have in the following screenshot



save your template and view you should see the ad float to the left below the post title if you want to center it just remove the float and change the margin so your code would something look like










if you would like to show them at the bottom of your post instead paste the given code just after the following code so it would look like mine in the screenshot below



if you would like to show them at both the top and bottom of your posts you should only show them on the post pages since we are only allowed to display a certain amount on each page so to get them at the bottom and top of your posts copy the following code












paste it above and below the tag so it should look something like the following screenshot



now if you save your template and view a post on your blog you should see ads at the top and bottom so now you know how to position those AdSense ads in your blog posts. If you enjoyed reading this tutorial don't forget to leave your comment and have fun tweaking your blog