• I have a blog with some long posts and some quick posts. I want to be able to show the latest 5 posts, but only the long posts. I have the quick posts denoted by a custom field called “quick”.

    I have tried the following code, but it doesn’t work entirely. It skips the quick posts, but only looks at 5 posts altogether. (So, if one is quick, it only displays 4 posts. If two are quick, it only displays 3 posts. And so on.)

    <?php query_posts('cat=6&showposts=5'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <?php if(get_post_meta($post->ID, 'quick', 'true')) continue; ?>
    <!-- DO STUFF... -->
    <?php endwhile; ?>
  • The topic ‘Skip post if custom field is true’ is closed to new replies.