• Andrew
    January 3, 2014 at 2:09 am #15903

    With the button shortcode, would it be possible to have the link wrap outside of the button so that the entire button is clickable (instead of just the text).

    Andrew
    January 3, 2014 at 2:10 am #15904

    I’m artificially making this feature by wrapping the button with an .

    crerem
    January 5, 2014 at 9:14 am #16474

    You can go into libs/shortcodes.php and around the line 1443 you will find the function for this shortcode

    to wrap the buttton inside the link you should replace
    $return_string = ‘<span class=”btn small ‘ . $attributes[‘color’] . ‘”>‘ . do_shortcode($attributes[‘text’]) . ‘</span>’;

    with something like this

    $return_string = ‘<span class=”btn small ‘ . $attributes[‘color’] . ‘”>’ . do_shortcode($attributes[‘text’]) . ‘</span>‘;

    I did not try this on a live version so css adjustments may be required

    Andrew
    January 6, 2014 at 9:06 pm #16934

    Hi crerem,

    Excuse my ignorance, the two lines look the same to me?

    thanks!

    crerem
    January 7, 2014 at 7:07 pm #17190

    Yes the forum interpreted the html code and transformed the text to an actual link

    let’s of this work

    
     $return_string = ‘<span class=”btn  small  ‘ . $attributes['color'] . ‘”>
    <a href="' . $attributes['link'] . '" rel="nofollow">‘ . do_shortcode($attributes['text']) . ‘</a>

    <a href="' . $attributes['link'] . '" rel="nofollow"><span class=”btn small ‘ . $attributes['color'] . ‘”>’ . do_shortcode($attributes['text']) . ‘</span></a>

You must be logged in to reply to this topic.