Viewing 1 replies (of 1 total)
  • Here’s an example:

    If custom field is present, formulate and display link from meta value

    <?php
    $link = get_post_meta($post->ID, 'link_url', true);
    $text = get_post_meta($post->ID, 'link_text', true);
    if ($link){
    echo 'Credit: <a href="'.$link .'">'.$text.'</a>';
    }
    ?>

    Related:
    Custom Fields

Viewing 1 replies (of 1 total)
  • The topic ‘How to only display a key’s Meta-value?’ is closed to new replies.