Small tweak for Themler SVG icons besides widget titles

Stagger Lee
1833 Posts
Stagger Lee posted this 23 April 2015

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 '&lt;i class=&quot;'. $content . '&quot;&gt;&lt;/i&gt;'; } 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; }
Vote to pay developers attention to this features or issue.
1 Comments
Order By: Standard | Newest
Support Team
Support Team posted this 28 April 2015

Hello,
let users vote for this feature.

In the near future, as I mentioned in other topic (http://answers.billiondigital.com/questions/10810/style-edit-post-display-template-in-themler-per-category-basis) custom PHP could be added to the theme and thus you may incorporate coding solution into the theme.
Later we'll introduce SDK that describes how to create custom controls and shortcodes.

Regards,
Aileen

Hello, let users vote for this feature. In the near future, as I mentioned in other topic (http://answers.billiondigital.com/questions/10810/style-edit-post-display-template-in-themler-per-category-basis) custom PHP could be added to the theme and thus you may incorporate coding solution into the theme. Later we'll introduce SDK that describes how to create custom controls and shortcodes. Regards, Aileen
You must log in or register to leave comments