Home » Featured, wordpress

125×125 Ad blocks for your Wordpress Sidebar


Submitted by Dan on Sunday, 13 July 2008One Comment
125×125 Ad blocks for your Wordpress Sidebar

Well I wasted my time with all of this crap. Shortly after implementing this (only a couple days) I found a plugin to do it for me. Creates 125×125 ads and auto-spaces them to fit in your sidebar. It also tracks clicks. Argh! What a waste.

While customizing this site I decided to add a block of 125×125 banner ads in my sidebar.  This feature was not included in the theme I am using and I had to add this myself using CSS.  I am not a designer by any means so I searched Google for a Wordpress theme that already had that feature and I just took the CSS code for it and added it to my blog.

Im going to share the method for doing this because this morning I found a visitor to my site who came here via Google when searching for how to add this exact feature.  To do this you must have access to your theme files to edit the stylesheet otherwise it will not work properly.  The theme I used the css from was SlickBlue.

I downloaded the theme and edited the stylesheet.css and adblocks.php files and removed the following code:

stylesheet.css

.sidebarbuttons {
width: 265px;
padding: 5px 10px 5px 10px;
margin: 0px 0px 10px 3px;
}

adblocks.php

The file ad.jpg is a sample image that can be used as a filler until you fill all your ad spots.  Copy the stylesheet code to your theme’s stylesheet.css file and copy the adblocks code to your sidebar.php file where you want the ads to appear or if your theme uses widgets you can insert that code into a widget.  All you need to do is replace the images and links with your own ad code.

For help with positioning and using Widgets you can visit my previous article on how to place widgets anywhere in your blog.

No TweetBacks yet. (Be the first to Tweet this post)

One Comment »

  • Web Design Ealing (2 comments) said:

    Thanks for this, I’ve been looking for something simmilar for a while now. I was surprised to find that there were no plugins for this, I did find something called CustomWidgets plugin, that’s the closest anything came to it.

    Thanks
    Sunny

    [Reply]

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.


Comments links could be nofollow free.