Aligning Adsense Ads in a WordPress Widget Sidebar!

I myself struggled with a proven method for tweaking the position of an adsense block in a WordPress theme’s sidebar. I’ve tried digging through the php files and css files to try to determine how they structured their website to change/add my own code to no avail. Finally today the answer came to me.

Wrap the script in a Div and use a class to re position it!

Step 1
Create a textbox widget in the location you want it to appear on the sidebar.

Insert the text into your Text Widget

<div class=”adsense_ad”>

</div>

Step 2
Paste your adsense code between the div blocks.

Step 3
Navigate to your Theme’s Options and add the class to your Theme’s Custom CSS section.

.adsense_ad{
position: relative;
left: -10px;
margin-left: 0px;
padding-left: 0px;}

Change the value of left: to suit your needs.