WordPress.org

Ready to get started?Download WordPress

Forums

Bold First Word of Widget Titles (3 posts)

  1. IlanK
    Member
    Posted 1 year ago #

    Hi, I'd like to bold the first word of my widget titles.

    How do I do this?

    Here's a link if it helps: http://www.payitforwardfriends.com

  2. IlanK
    Member
    Posted 1 year ago #

    Got it!
    Used this widget: http://wordpress.org/extend/plugins/linkable-title-html-and-php-widget/installation/

    Still unclear on how to do it though for non-text widgets. Help?

  3. catnip216
    Member
    Posted 1 year ago #

    Not sure if you still need this, but I was looking to do the same thing, and found this: http://www.brinzan.com/2012/01/wordpress-add_filter-for-widget-titles/

    The span tags were stripped out of the post, and then again in my comment on the post. This is what should actually go in functions.php:

    /************* FIRST WORD BOLD IN WIDGET TITLE *****************/
    
    add_filter ('widget_title', 'wpzoom_fix_widgets');
    
    function wpzoom_fix_widgets($old_title) {
    
        $title = explode(" ", $old_title,2);
    
        $titleNew = "<span>$title[0]</span> $title[1]";
    
        return $titleNew;
    
    }

    'Course the span tags could easily be strong or em tags instead, whichever suits your purposes best.

    Hope this helps :-)

Topic Closed

This topic has been closed to new replies.

About this Topic