I’ve been asked the question before: “How can I display 125×125 ads in a sidebar widget in Thesis?”
This one is a pretty simple one to answer, and we can even use a widget to do it. I recommend that you grab a widget that can parse PHP so that you can control how you want your 125×125 ads displayed throughout your site. If you decide not to use a PHP widget, a regular text widget will work just fine.
The reason why we want to use a widget is because we have better control over where our ads can be placed in our sidebar.
The Widget and the HTML
First we need to go to our widgets panel and drag a new text widget into our widget sidebar. Once you have placed a new widget there, copy and paste the following code inside of the widget:
<ul class="goodies"> <li class="left"> <a href="[YOUR LINK HERE]"> <img src="[YOUR IMAGE PATH HERE]" alt="[YOUR ALT TAG HERE]" width="125px" height="125px" border="0" /> </a> </li> <li class="right"> <a href="[YOUR LINK HERE]"> <img src="[YOUR IMAGE PATH HERE]" alt="[YOUR ALT TAG HERE]" width="125px" height="125px" border="0" /> </a> </li> <li class="left"> <a href="[YOUR LINK HERE]"> <img src="[YOUR IMAGE PATH HERE]" alt="[YOUR ALT TAG HERE]" width="125px" height="125px" border="0" /> </a> </li> <li class="right"> <a href="[YOUR LINK HERE]"> <img src="[YOUR IMAGE PATH HERE]" alt="[YOUR ALT TAG HERE]" width="125px" height="125px" border="0" /> </a> </li> </ul>
Basically what we are doing is setting up an unordered list in our widget that displays an ad on the left and an ad on the right. We make this happen by styling it in our custom.css file.
Be sure to replace the hyperlinks, images and alt tags with your own code.
The CSS
Now it’s time to style our 125×125 ads in our Thesis sidebar widget. Copy and paste the following code somewhere in your custom.css file:
.custom .sidebar ul.goodies li.left { float: left; margin-bottom: 10px; margin-right: 5px; }
.custom .sidebar ul.goodies li.right { float: right; margin-left: 5px; margin-bottom: 10px; margin-right: 10px; }
.custom .sidebar ul.goodies li a { display: block; }All we are doing here is floating one set of ads to the left and another to the right, adding appropriate spacing in between and setting the hyperlink to display as a block.
That’s all it takes! Setting up the ads in our Thesis sidebar is fairly simple, and it is easy to add or subtract from the ads in our widget. If you want to place more ads into your sidebar, simply copy all the code within the <li></li> tags and set the appropriate class for it (either left or right).
Enjoy your new 125×125 sidebar ads!


Thomas,
I’m really enjoying following your tutorials. They are easy to understand, and easy to install. However, as a newbie, could you explain to me where I find the information for my hyperlinks, images and alt tags, so that I can put in my own code? I don’t understand what you mean by these words, or where I can find that information, for these display ads.
David.
I’m glad you are enjoying these tutorials David!
The information for your hyperlinks will be given to you when you sign up for an affiliate program. They will provide you with your own custom URL that you can insert into the URL field. They will also provide you with images that you can link to in the
srcfield of your img tag.Image alt tags are simply words that describe your image in the event that your images do not load. It also gives search engines a way to understand how to ‘read’ you images. This text can be anything you would like it to be.
Hope this helps!
I’ve added to my blog.
One problem with your CSS code if I added to my site before, but it was solved. Just changed the margin left or right with 1px. (probably our sidebar size isn’t the same).
Thanks for this.
Hello,
Could you please tell me if it’s possible to add more columns ? and, of course how to do it ?
Because i’m thinking of using it like a menu for some featured products on my site.
Idealy i would like to use 4 columns.
Thanks
Vlad