WordPress.org

Ready to get started?Download WordPress

Ideas

Images as Widget Titles

  1. Lassirra
    Member

    12345

    It would be helpful to be able to specify an image as the "title" of a widget, instead of being forced to use text or not specify a title and then have to include the image in the body of the widget instead. For sites with a lot of content in the sidebar, it really helps add visual appeal if you're not just using a bunch of text.

    As it stands now, if I forgo a text title and include an image in the body of a widget to act as a faux title, when I look in my Dashboard I see a slew of widgets that just say "Text"--telling me nothing about which widget is which until I open them to see.

    I would like to have something added to the widgets interface where I should specify an image as the title, and in the Dashboard I could either see the image or a smaller version of it as the title so I know which is which at a glance.

    Barring that, it would be nice if we could specify "hidden" titles for widgets that would only be visible in the Dashboard. That way, if we're forced to place title images within the body of widgets, we could at least use the "hidden" title to tell them apart easily.

    Posted: 4 years ago #
  2. LoneWolfMuskoka
    Member

    12345

    If an image is used for a title, there should be an "Alt" field as well for the image that can be used where appropriate.

    Posted: 4 years ago #
  3. andykillen
    Member

    12345

    You can do what you want with CSS.

    Images used as titles use Text Replacement techniques and will never have ALT= in them as they do not use HTML <img> tag

    Basically every widget is named and thus every title has a unique name or class... so for example....

    this in your style.css
    #sidebar .widget-categories h4 {background: transparent url(image.png) no-repeat; width:200px; height:20px}
    #sidebar .widget-categories h4 span {dispaly:none}

    and this in your functions.php
    register_sidebar(array(
    'name'=>'Sidebar',
    'id'=>'sidebar',
    'description'=>'This is the sidebar.',
    'before_widget' => '<div class="sidebarBox">',
    'after_widget' => '</div>',
    'before_title' => '<h4><span>',
    'after_title' => '</span></h4>'
    ));

    This is only an example and will most likely not work out the box for your site, but trust me the technology and possibilities are already there for what you want.

    Posted: 4 years ago #
  4. Justin Tadlock
    Member

    12345

    This should be done via CSS.

    Posted: 4 years ago #
  5. Gallbladder
    Member

    I must agree with andykillen because I usually do that on my blog. Via CSS.

    Posted: 3 years ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    13 Votes
  • Status

    This is theme territory