Custom field outside the loop

  1.  
  2.  
  3.  
  4.  
  5.  
<?php
global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'customField', true);
?>

Instructions:

Display your custom field outside the loop.


Share this snippet

If you like this snippet, share it with friends!