• Join the Best Wordpress and Elementor Support forum

    Provide or get advice on everything Elementor and Wordpress, ask questions, gain confirmation or just become apart of a friendly, like minded community who love Wordpress and Elementor


    Join us!

Call ElementorPro share-buttons widget programatically in wordpress single page

S

sbaya

New Member
I have call the share-buttons widget from elementor pro component and it is displaying correctly.
The only issue is that, it is not applying the click trigger on the different social icons which works fine if it is added from elementor page builder.

Below is my code:

$social_share = \Elementor\Plugin::instance()->elements_manager->create_element_instance([
'elType' => 'widget',
'widgetType' => 'share-buttons',
'id' => 'recette-page-share',
'settings' => [
'share_buttons' => [ [ 'button' => 'facebook' ], [ 'button' => 'twitter' ]],
'view' => 'icon',
'skin' => 'flat',
'shape' => 'circle',
'alignment' => 'center',
'share_url_type' => 'current_page',
]
], []);

$social_share->print_element();
 

Latest Resources

Other Elementor Resources

elementor official

Still stuck? Ask the forum

Post your question with a screenshot and a link if you can, and a member will usually reply within a day. Free to join, no sales pitch.

Create a free account
Top