"Button" shortcode not working in Royal Theme

This topic has 2 replies, 2 voices, and was last updated 6 years, 10 months ago ago by Rose Tyler

  • Avatar: pablostevens
    pablostevens
    Participant
    May 31, 2017 at 20:21

    Just an FYI, maybe you can include in next update. The [button] shortcode is missing the URL. I added it to the shortcodes.php and fixed it.
    LINE: 1340

    add_shortcode(‘button’, ‘etheme_btn_shortcode’);
    function etheme_btn_shortcode($atts){
    $a = shortcode_atts( array(
    ‘title’ => ‘Button’,
    ‘href’ => ‘#’,
    ‘icon’ => ”,
    ‘size’ => ”,
    ‘style’ => ”,
    ‘el_class’ => ”,
    ‘type’ => ”
    ), $atts );
    $icon = $class = ”;
    if($a[‘icon’] != ”) {
    $icon = ‘<i class=”fa fa-‘.$a[‘icon’].'”></i>’;
    }
    if($a[‘style’] != ”) {
    $class .= ‘ ‘.$a[‘style’];
    }
    ***********ADDED*********************
    if($a[‘href’] != ”) {
    $class .= ‘ ‘.$a[‘href’];
    }
    ***************up to here********
    if($a[‘type’] != ”) {
    $class .= ‘ ‘.$a[‘type’];
    }
    if($a[‘size’] != ”) {
    $class .= ‘ ‘.$a[‘size’];
    }
    if($a[‘el_class’] != ”) {
    $class .= ‘ ‘.$a[‘el_class’];
    }
    return ‘<span>’. $icon . $a[‘title’] . ‘</span>‘;
    }

    1 Answer
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    June 1, 2017 at 14:17

    Hello,

    I sent your report to our developers.
    Thank you for the notice.

    Regards,
    Rose Tyler.

  • Viewing 2 results - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.