Forums

Changing sidebar widget titles to images (5 posts)

  1. krez
    Member
    Posted 1 week ago #

    Hello,

    I am trying to change the titles of my sidebar widgets (i.e. "Pages," "Recent comments," "Meta," etc) to images. Since my sidebar is widgetized, it seems this is more difficult than simply changing a few things in my sidebar.php document.

    Does anyone have any tips?

    Thank you.

    -ben

  2. MichaelH
    Moderator
    Posted 1 week ago #

    The RSS widget show an RSS image so look in wp-includes/widgets.php (line 1068 in 2.5.1) for an example of that.

  3. krez
    Member
    Posted 1 week ago #

    Michael,

    Thanks, but I think you may have misunderstood my question. I know how to generally put images in the sidebar -- but how do I replace the TITLES with images, for example how do I replace the text "Pages" with a custom image I've made?

    -ben

  4. MichaelH
    Moderator
    Posted 1 week ago #

    I believe I understand, but i don't think you are going to be able to do that with the help of some plugin (don't know of one), or 'hacking' the core code.

  5. jerhoyet
    Member
    Posted 1 week ago #

    You should be able to do this pretty easily with a bit of CSS.

    Each widget title is between nifty <h2> tags before each widget title is an

  6. tag with a specific class for each type of widget. For instance, the recent comments widget looks like this on your site (up to the title):

    <li id="recent-comments" class="widget widget_recent_comments"> <h2 class="widgettitle">Recent Comments</h2>

    With a bit of CSS, you could easily just hide the text and display a background image in it's place:

    .widget_recent_comments h2 {
    text-indent: -9999px;
    background-image: url('imageurl.jpg');
    display: block;
    width: 100px;
    height: 100px;
    }

    Something around those lines should get you started, then just make a similar title for each widget (you can find their class by viewing the source of your blog).

Reply

You must log in to post.

About this Topic

Tags