Styling widget titles with sprite image

  • Anonymous



    can anyone refer me to post where is explanation on modifying widget titles with sprite image.

    Something like this: 😉

    I guess it’s sprite image, correct me if I’m wrong …



    Sample custom CSS code –

    #widget-id .widget-title-icon {
    background: url("icon URL") no-repeat ;


    or give this plugin a try. DP Widgets Plus –



    You also need to add this to your child theme functions.php file:

    * Modify the widget title to include an image placeholder
    function graphene_modify_widget_title( $sidebar ){
    global $wp_registered_sidebars;

    // If this is not the widget area we want to change, don't do anything
    // if ( $sidebar['id'] != 'sidebar-widget-area' )
    // return;

    // Modify the title parameter
    $sidebar['before_title'] = $sidebar['before_title'] . '<span class="widget-title-icon"></span>';

    // Pass in the modified parameters to the registered sidebar array
    $wp_registered_sidebars[$sidebar['id']] = $sidebar;
    add_action( 'register_sidebar', 'graphene_modify_widget_title' );



    lol.. I’m not so smart, just extracted the code behind widget h3 icon.. 🙂



    Thanx Josh,

    that’s what’s bugging me…

    I’ll try that plugin also, thnx Prasanna

Viewing 5 posts - 1 through 5 (of 5 total)

  • You must be logged in to reply to this topic.