'Elementor icons control icon not showing
My elementor icons control icon not showing. When I drag and drop my widget into elementor edit section for the first time then it's not (Icon not showing) working but when I change my icon then it showing fine. What's the problem? And how can I solve the problem?
<?php
namespace MeetTheTeam\Widgets;
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class MTTTest extends Widget_Base {
public function get_name() {
return 'team-mtt-widgetdd';
}
public function get_title() {
return __( 'Team Sectionsdd', 'meet_the_team' );
}
public function get_icon() {
return 'eicon-image-rollover';
}
public function get_categories() {
return [ 'meet-the-team' ];
}
public function get_script_depends() {
return [ 'meet_the_teamd' ];
}
protected function _register_controls() {
$this->start_controls_section(
'section_icond',
[
'label' => __( 'Icon', 'text-domain' ),
]
);
$repeater = new \Elementor\Repeater();
$repeater->add_control(
'mtt_social_icon_three_sk',
[
'label' => esc_html__( 'Icon', 'meet_the_team' ),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'fab fa-linkedin',
'library' => 'solid',
],
]
);
$this->add_control(
'mtt_boxfgfg',
[
'label' => esc_html__( 'Meet The Team', 'meet_the_team' ),
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'default' => [
[
'mtt_box_title' => esc_html__( 'Title #1', 'meet_the_team' ),
],
[
'mtt_box_title' => esc_html__( 'Title #2', 'meet_the_team' ),
],
],
'title_field' => `{{{ mtt_box_title }}}`,
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
if ( $settings['mtt_boxfgfg'] ) {
foreach ( $settings['mtt_boxfgfg'] as $item ) {
?>
<div class="test_icon"><i class="<?php echo esc_html($item['mtt_social_icon_three_sk']['value']); ?>"></i></div>
<?php
}
}
}
protected function _content_template() {
?>
<# if ( settings.mtt_boxfgfg.length ) { #>
<# _.each( settings.mtt_boxfgfg, function( item ) { #>
<div class="test_icon"><i class="{{{item['mtt_social_icon_three_sk']['value']}}}"></i></div>
<# }); #>
<# } #>
<?php
}
}
Solution 1:[1]
Maybe you don't have the font awesome script loaded with fab fa-linkedin, try with fa fa-linkedin
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | BoBiTza |
