How to skip posts based on Custom Field
I’ve trying to do this for the past week or so and I seem to have exhausted my patience. What I want to do sounds simple, but I can’t find any documentation for it.
I have an events website. Once an event happens a recap of the event is written in a custom field. The thing is that the recap may not be written right away.
So what I want to do is have a way to display the most recent post that has a recap.
Post A: dated 1 day ago, has no recap
Post B: dated 5 days ago, has recap
Loop displays Post B, the latest post with a recap in a custom field.
This is what I have, which does not work:
<?php query_posts('cat=5&showposts=1'); ?> <?php while (have_posts()) : the_post(); ?> <?php $check = get_posts('numberposts=1'); ?> <?php $eventrecap = get_post_meta($post->ID, 'event recap', true); if ($eventrecap=="") continue; ?>
I’m pretty new to conditional statements and any help is appreciated!
- The topic ‘How to skip posts based on Custom Field’ is closed to new replies.