Support

Account

Home Forums General Issues Changing get_field link

Solved

Changing get_field link

  • Hello,

    I am relatively new to ACF, and I am hoping someone can help.

    I see this code:
    a href < ? echo get_field(“net_members_stock_check_links”); ?>

    which in turn becomes a link on my website that is associated with a button. What I cannot figure out is how this turns into a link? The get_field is replaced with a link to a website and I don’t know how or where this website is put into play. I cannot find where I would change which website the button is directed to!

    Any direction would be greatly appreciated.

    Jacob

  • Hi @jacoblhughes

    I’m afraid I don’t understand the current state of the link and how you want it to be. Could you please share the screenshot of it and let me know the result you expected?

    If you want to add it as a link, you need to use the a HTML tag like this:

    <a href="<? echo get_field('net_members_stock_check_links'); ?>" >Link Title</a>

    If you want to use a button, you can try the following code:

    <button onclick="location.href='<? echo get_field('net_members_stock_check_links'); ?>'" type="button">Link Title</button>

    This page should give you more idea about it: http://stackoverflow.com/questions/2906582/how-to-create-an-html-button-that-acts-like-a-link.

    Because this is more related to HTML, kindly visit their community instead.

    I hope this makes sense 🙂

  • Thank you so much. Your post sent a spark to my brain and I figured out what was wrong!

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Changing get_field link’ is closed to new replies.