Using Images to Replace Widget Titles

So the blog design calls for the sections in our sidebar to be images and I really wanted to use wordpress widgets instead of the standard functions to manage them. This means I needed to figure out a way to suppress the default text titles and display the images.

I could edit wp-includeswidgets.php but then we would have to remember to redo the changes everytime we upgrade wordpress.

So the solution I’ve come up with is to enter a space (using the aascii character code) as the custom title and then use css to define a background image as the title graphic for each widget’s class.

The biggest drawback is if someone has css or images turned off (browsing with their mobile for instance), they would not see any titles on the sidebar. Most of them are obvious, so not a major penalty.

Update: I ditched widgets for functions, I needed a lot more flexability than I could hack with widgets.

Leave a Reply

Your email address will not be published. Required fields are marked *