WordPress.org

Support

Support » Themes and Templates » Hyperlinks in metadata

Hyperlinks in metadata

  • Hello

    I was helped earlier my MichaelH, thanks to him!

    Right now im using the code below to display my metadata:

    <?php
    $website= get_post_meta($post->ID, 'website_value', true);
    if ($website){
    echo 'Website: '.$website;
    }
    ?>

    My question is how do I make the website when it displays the link a hyperlink…?

    So basically in the WP admin you can put in ‘www.mysite.com’ and http://www.mysite.com will appear as a hyperlink in the metadata…

    Dave

Viewing 1 replies (of 1 total)
  • Moderator Michael

    @alchymyth

    Forum Moderator

    <?php
    $website= get_post_meta($post->ID, 'website_value', true);
    if ($website){
    echo 'Website: <a href="http://'.$website.'">'.$website.'</a>';
    }
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Hyperlinks in metadata’ is closed to new replies.