How to add target"=_blank" to the URL Custom Field Type?

Support General How to add target"=_blank" to the URL Custom Field Type?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38253
    tumikia@twkwebandprintdesign.com[email protected]
    Participant

    I need the URL Custom Field Type to open in a new tab. How do I add target="_blank"?

    #38265
    Long NguyenLong Nguyen
    Moderator

    Hi,

    When outputting the field value, you can add the attribute to the HTML code. For example:

    <a href="<?php echo rwmb_meta( 'field_URL_id' ); ?>" target="_blank"><?php echo rwmb_meta( 'field_URL_id' ); ?></a>

    to open the URL in a new tab. Read more on the documentation https://docs.metabox.io/displaying-fields-with-code/

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