DEAL ENDS IN:

SUMMER SALE!

UP TO 35% OFF!

GET IT NOW

Elementor button element doesn’t render shortcodes

The Elementor button element does not automatically render shortcodes in the “text” field.

If you wish to include an If-So shortcode within an Elementor button field to display dynamic text on the button, you can add the following code snippet to the end of your functions.php file.

//Elementor button - render shortcode in URL
add_filter('elementor/widget/before_render_content',function($el){
    if($el->get_name()==='button'){
        $link_setting = $el->get_settings('link');
        if(!empty($link_setting)){
            $link_setting['url'] = do_shortcode($link_setting['url']);
        }
        $el->set_settings('link',$link_setting);
    }
});