Skip to main content
1 of 2
tfrommen
  • 9.2k
  • 7
  • 39
  • 59

I think, you're mistaken in how if works...?

global $wp_query;
$postid = $wp_query->post->ID;
if ( ! empty( get_post_meta($postid, 'TourURL', true) ) ) echo '<P>Show Link</P>';
else echo '<P>No Link</P>';
wp_reset_query();

This should do what you want - if I understood you correctly.

// Edit

If you want to work with the meta data, you might want to use a variable to store the data, then check if this variable is empty.

tfrommen
  • 9.2k
  • 7
  • 39
  • 59