Now I am going a WordPress lesson and do everything what teacher do on Youtube lesson. Just made custom widget in Elementor. But it is no icon in it.
Here is a code inside of Widget. What I don’t understand?
/**
* Get widget icon.
*
* Retrieve About widget icon.
*
* @since 1.0.0
* @access public
*
* @return string Widget icon.
*/
public function get_icon() {
return 'fa fa-code';
}
2
Answers
Just figured out that such class as was in default
"fa fa-code"
doesn't work in Elementor. For Elementor works only"eicon-code"
Here is all list:Elemetor icons
For example this code will work:
the only way that I found to add a custom icon to the widget is you have to make your font icon(if you don’t want to use something like FontAwesome)
and load it to your widget function file.
(Tip: if the icon didn’t load correctly just add
font-family:"the font family name of your icon" !important to the icon style file)
the plugin file to load the style(the 4th picture):