
Functions.php, or functions.php inside a plugin (better solution for working with Themler):
/**
* Function to allow for HTML in widget titles
* usage:
* [themler]icon-adjust[/themler] Widget Title Name
*/
add_filter( 'widget_title', 'do_shortcode' );
add_shortcode( 'themler', 'so_shortcode_themler' );
function so_shortcode_themler( $attr, $content ) {
return '<i class="'. $content . '"></i>';
}
Widget title like this:
[themler]icon-folder-open[/themler]Categories
CSS for margin control. Or control it with spaces after shortcode in widget title. Change sidebar ID to your own, or add multiple sidebars:
.bd-sidebararea-1 .bd-container-inner .bd-tagstyles [class^="icon-"],
.bd-sidebararea-1 .bd-container-inner .bd-tagstyles [class*=" icon-"] {
color: #d9534f;
margin: 0 10px 0 0;
}
Functions.php, or functions.php inside a plugin (better solution for working with Themler):
/**
* Function to allow for HTML in widget titles
* usage:
* [themler]icon-adjust[/themler] Widget Title Name
*/
add_filter( 'widget_title', 'do_shortcode' );
add_shortcode( 'themler', 'so_shortcode_themler' );
function so_shortcode_themler( $attr, $content ) {
return '<i class="'. $content . '"></i>';
}
Widget title like this:
> [themler]icon-folder-open[/themler]Categories
CSS for margin control. Or control it with spaces after shortcode in widget title. Change sidebar ID to your own, or add multiple sidebars:
.bd-sidebararea-1 .bd-container-inner .bd-tagstyles [class^="icon-"],
.bd-sidebararea-1 .bd-container-inner .bd-tagstyles [class*=" icon-"] {
color: #d9534f;
margin: 0 10px 0 0;
}