Displaying links in single event template

WordPress Event Management, Calendars & Registration Forums Frontend Submissions Displaying links in single event template

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 9 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #19223

    Hi Stephen,

    I am using the following code to display an “application link” to an event but it just outputs text.

      <?php   
    if ( get_post_meta( get_the_ID(), 'eo_application_link', true ) ) {
         printf( '
  • Application Link: %s
  • ', esc_html( get_post_meta( get_the_ID(), 'eo_application_link', true ) )); } ?>

    How do I make it output the text stored in the meta key as a link instead?

    Thanks, Lukas

    • This topic was modified 9 years, 2 months ago by  Lukas Feddern.
    Lukas Feddern
    #19236

    Try:

    <?php   
    if ( get_post_meta( get_the_ID(), 'eo_application_link', true ) ) {
         printf( 
             'Application Link: <a href="%1$s">%1$s</a>',  
             esc_url( get_post_meta( get_the_ID(), 'eo_application_link', true ) )
         ); 
    } 
    ?>
    
    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.