• P3Hamburg

    (@p3hamburg)


    Hey!

    I insert a button via this plugin and tried to link it. This is my code:

    <a onfocus="this.blur()" href="URL">
     [su_button background="#B90000" radius="square" icon="icon: arrow-right"] Text [/su_button]
     </a>

    But no matter which URL I use, it always redirects me to the homepage and ignores the right URL.
    All URLs I used are working, I tried them without the button-shortcode.
    I also tried this code at different websites with different website-templates.

    So I think it’s a bug in the plugin…

    https://www.ads-software.com/plugins/shortcodes-ultimate/

Viewing 3 replies - 1 through 3 (of 3 total)
  • GoldHatTrick

    (@goldhattrick)

    I’m pretty sure you need to have the button url inside this shortcode to link the button, not around the button shortcode.

    [su_button url="yourURL" background="#bebde9" color="#fff" class="yourcss"]WhatTheButtonSays[/su_button]

    This button shortcode isn’t just for the button image. It has an attribute to take a url built in.

    Thread Starter P3Hamburg

    (@p3hamburg)

    Hey!
    Thanks for your answerbut it doesn’t work either. The button becomes a link-button with url=”yourURL” inside the shortcode, but it also redirects me back to the homepage. :/

    GoldHatTrick

    (@goldhattrick)

    Hmmm…

    I played around with the shortcode & discovered this:

    If the url attribute is missing or not validly written, the button will default to the homepage automatically.

    If I put the a-href around the button, I get a hyperlink just to the left of the button. That a-href can work but looks like a blank spot which I only noticed because I have custom identifiers for links that adds an icon to the end of them.

    If the button AND the a-href both have valid urls, then the spot to the left of the button will go to the a-href url & the button goes to its url.

    I was able to get working buttons with absolute & relative urls, shortlinks & pretty permalinks, internal & external links. Other than the relative links, all urls were coded like

    [su_button url="https://www.blahblah.com/mypost/"]BUTTON[/su_button]

    Other thoughts:

    Have you tried with an external link? If the external link works, then your internal links might be getting redirected.

    I know my SEO has the option to redirect 404 pages & invalid links back to the homepage. This includes clicks on images, icons, etc. Could something like this be happening?

    If it still isn’t working, you can always try using the regular button html tag instead of the shortcode. You will have to do all the custom css for it yourself, though.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Link-Buttons don't work!’ is closed to new replies.