Php code

<?php
//* Do NOT include this comment or the opening php tag above
//* Wrap first word of widget title into a span tag
add_filter ( 'widget_title', 'b3m_add_span_widgets' );
function b3m_add_span_widgets( $old_title ) {
  
  $title = explode( " ", $old_title, 2 );
	
	if ( isset( $title[0] ) && isset( $title[1] ) ) {
		$titleNew = "<span>$title[0]</span> $title[1]";
	}
	else {
		return;
	}
	
	return $titleNew;
}

Css code

/* The CSS code you will need to customize and add into your stylesheet */
.widgettitle {
    border-bottom: 1px solid #DDDDDD;
}
 
.widgettitle span {
    border-bottom: 1px solid #F0591A;
    color: #F0591A;
    display: block;
    float: left;
    margin: 0 5px 0 0;
}

Bây giờ widget title của bạn từ đầu tiên đã được bọc trong thẻ <span></span> và bạn style theo ý muốn