Styling widget titles with sprite image

  • Luko

    #2551

    Hy,

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

    Something like this: http://joshlobe.com 😉

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

    Prasanna SP

    #18060

    Sample custom CSS code –

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

    }

    or give this plugin a try. DP Widgets Plus – http://wordpress.org/extend/plugins/dp-widgets-plus/

    Josh

    #18061

    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' );

    Prasanna SP

    #18062

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

    Luko

    #18063

    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.