[icon type="icon-lamp"]
jQuery(document).ready(function ($) { //noconflict wrapper // widget object - acts like a class var widget = { news : "rss", tweet : "twitter", event : "calendar", note : "pencil-square-o", download : "download", contact : "phone", setIcon : function(icon) { var myreturn; Object.keys(this).forEach(function (key) { if(icon===key) { myreturn = ' '; } }); // end foreach loop return myreturn; } // end setIcon }; // end widget object // // in $(<your selector>:contains("Your widget title").append(widget.setIcon('<key_name>')); $('h3:contains("News")').append(widget.setIcon('news')); // returns : <h3 class="widget-title"><span class="widget-inner">News</span><i class="fa fa-rss fa-fw"> </i></h3> // $('.widget-title:contains("Tweets")').append(widget.setIcon('tweet')); $('.widget-title:contains("Resources")').append(widget.setIcon('download')); $('h3:contains("Contact")').append(widget.setIcon('contact'));}); //end noconflict
Comments
yes, it is possible. Just use the following shortcode next to the title: <i class="ICON-NAME"></i>