get Custom Field outside the loop


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. global $wp_query;
  3. $postid = $wp_query->post->ID;
  4. echo get_post_meta($postid, 'customField', true);
  5. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.