How to add custom field URL value to a button?

Support General How to add custom field URL value to a button?Resolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #30006
    s.liem@me.com[email protected]
    Participant

    Hi

    I want to add the value of a URL-Field to a button, currently set up as seen on this screenshot.

    But on frontend it's not showing the URL pasted in the button_url field, as you can see here (mouse hovered on button, but mouse is not displayed on screenshot).

    Instead of the URL added in the custom field, the button will redirect to the URL of the post.

    How can I insert the URL to this button?

    Thank you in advance and kind regards,
    Sascha

    #30012
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The helper shortcode only shows the raw URL on the frontend without styling in a button like that. Did you add another button and hovering it?

    To show the URL field value in a button, you need to assign it to the attribute href of the <a> tag to make it clickable. Just like

    <a href="<?php echo rwmb_meta( 'field_url_id' ) ?>">Button Link</a>

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.