By using Elementorforum.com’s services you agree to our Cookies Use and Data Transfer outside the EU.
We and our partners operate globally and use cookies, including for analytics, personalisation, ads and Newsletters.

  • Join the Best Unofficial 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!
elementor official

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();
 
elementor official

Latest posts

Other Elementor Resources

elementor official
elementor official
Top