Skip to content

Instantly share code, notes, and snippets.

@tomess
Created February 1, 2013 16:20
Show Gist options
  • Save tomess/4692308 to your computer and use it in GitHub Desktop.
Save tomess/4692308 to your computer and use it in GitHub Desktop.
Wordpress: Display Custom Field only if exist
<?php
$url = get_post_meta($post->ID, 'snippet-reference-URL', true);
if ($url) {
echo "<p><a href='$url'>Reference URL</a></p>";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment