post with specific Custom Field


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



Copy this code and paste it in your HTML
  1. <?php if (have_posts()) :
  2. while (have_posts()) : the_post();
  3. $customField = get_post_custom_values("img");
  4. if (isset($customField[0])) {
  5. //Custom field is set, display post info
  6. the_title();
  7. the_excerpt();
  8. }
  9. endwhile;
  10. endif;
  11. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.