WordPress.org

Ready to get started?Download WordPress

Forums

How can I link a button to a URL? (4 posts)

  1. npekala
    Member
    Posted 2 years ago #

    Hi:

    I'm a newbie to WordPress and fairly new to HTML. I've tried everything I can think of but can't get my button to link to the URL I want to direct it to. I think I'm missing something basic about how to place the URL within the bracket. Can someone help? Here is the code I'm working with. The button itself is displaying with the text I want (Download E-book) but the link is not going to the one I've placed here. Any help would be much appreciated.

    ------------

    [button style="glass" size="small" icon="arrow-dark" textcolor="#f5f0f0" bgcolor="#0a88f7" ]Download E-book[/button]

  2. s_ha_dum
    Member
    Posted 2 years ago #

    Is this a shortcode? If so, what plugin, theme, or code is providing it?

    It isn't HTML. HTML doesn't use square brackets in that context. You need < and > instead.

  3. mannyboi
    Member
    Posted 2 years ago #

    As said, this seems like a shortcode. Check the theme documentation (if avalible), it should be thoroughly explained there.

    On second thought, if i am not mistaken, is this what the code you posted looks like?
    [button style="glass" size="small" icon="arrow-dark" textcolor="#f5f0f0" bgcolor="#0a88f7"] <a>Download E-book</a>[/button]

    ...considering there is a link in your text going nowhere. If so, then the explanation is easy, you just need to add the destination for the link, like this;
    [button style="glass" size="small" icon="arrow-dark" textcolor="#f5f0f0" bgcolor="#0a88f7"] <a href="http://www.YOUR-LINK-HERE.com">Download E-book</a>[/button]

  4. npekala
    Member
    Posted 2 years ago #

    Thanks very much for your help on this. Yes, this is a shortcode for a button in the Natural theme. There wasn't anything about linking to the buttons in the documentation but after playing around with your suggestion, I found the magic formula that worked. The trick was inserting brackets around the a href. Here it is just fyi:

    [button style="glass" size="small" icon="arrow-dark" textcolor="#f5f0f0" bgcolor="#0a88f7" [a href="http:"]Read More[/button]

    Thanks again!

Topic Closed

This topic has been closed to new replies.

About this Topic