WordPress.org

Support

Support » How-To and Troubleshooting » query_posts in child category

query_posts in child category

  • As short as possible… been working on this all day.

    The situation is that I cannot find an effective way to sort posts based on a custom field meta info of a future date (YYYY-MM-DD). I thought there might be a way to “future date” posts and still have them displayed on the site – there is.

    Unfortunately, what I’m running into is that while all of the posts display on the parent category list (archive.php), they will not display when you go to the child category list.

    How I’m getting there, (code found on other posts):

    <?php get_header(); ?>
    
    <?php query_posts('post_status=future,publish&orderby=date'); ?>
    
    <?php if (have_posts()) : ?>
    
    blah blah blah
    
    <?php while (have_posts()) : the_post(); ?>
    
    post blah blah
    
    <?php endif; ?>
    
    <?php endwhile; ?>
    
    next / previous
    
    <?php else : ?>
    
    Not Found
    
    <?php endif; ?>

    Is there something I’m missing that would make this work on the child pages, short of tearing it all apart and starting over?

  • The topic ‘query_posts in child category’ is closed to new replies.