Forums

[resolved] Displaying Future Posts Using a Custom Select Query (3 posts)

  1. Nathan Reynolds
    Member
    Posted 2 years ago #

    This question revolves are the codex article, Displaying Posts Using a Custom Select Query.

    I'm using a category to display upcoming events by using <?php query_posts('showposts=10&post_status=future'); ?> on the specific categories template.

    So what I'm trying to do is have custom fields for the speakers for the events. I want to create a page for each speaker, with a list of the upcoming (and previous but that's easy) events.

    However the query used in the codex uses wposts.post_status = 'publish' (which works great for past events) but if I use wposts.post_status = 'future' it displays the display else.

    What can I do?

  2. MichaelH
    Volunteer
    Posted 2 years ago #

    If you use query_posts (or get_posts or new WP_Query) then in your loop you will have access to the post ID and that's what you'd need to retrieve the custom fields for that post/page.

    Related:
    Using_Custom_Fields

  3. Nathan Reynolds
    Member
    Posted 2 years ago #

    Wow, I'm stupid.

    No wonder it wouldn't call future posts if I have wposts.post_date < NOW()

Topic Closed

This topic has been closed to new replies.

About this Topic