Support » Fixing WordPress » Query specific time period for post to show

  • Good day!

    I’ve a semi-static front page with a small area where I’d like the latest post in its category to show.

    Currently, I’m using an exclusion tag to querey only a specific catagory – and that works great if I delete and rewrite the post at every necessary opportunity.
    (ex: < ?php query_posts(‘cat=3’); ?> and then the Loop)

    But what I’d like is to put a series of posts into the category in advance, and have the field show the most timely post [based on time stamp?]

    can anyone lend a stumbling learner a hand…

    I’ve read Template Tags/query posts (http://codex.wordpress.org/Template_Tags/query_posts) but I don’t quite get how to accomplish what I need.

    I appreciate all the assistance to date
    (you know who you are)

    -DA

Viewing 11 replies - 1 through 11 (of 11 total)
  • What is “the most timely post”?
    Can’t you just use the timestamp and make ‘future’ posts that will appear on the date you set in the timestamp?

    Thread Starter devils_advocate

    (@devils_advocate)

    The wise moshu wrote:
    “What is “the most timely post”?
    Can’t you just use the timestamp and make ‘future’ posts that will appear on the date you set in the timestamp?”

    Ok. So I CAN use the timestamp…but how do I make

    a) ONLY a single post appear in the (tiny) little window and
    b) make just the post that is current to that month or set of weeks show in the window?

    a) I don’t know what is (and where) is your “tiny little window
    I don’t know what method are you using to display the post(s) there
    b) until the new date “kicks in” the future post will not appear

    Thread Starter devils_advocate

    (@devils_advocate)

    applecorps.michaelbriney.com (temporarily)
    the lower right corner of the page is a announcement box for who is coming and when.

    If a second post is made to the category, I do not want it to
    a) break the box
    or wrap, or scroll
    I just want the second, or third or fourth or fifth…(etc) to show

    method to post is:

    <td>< ?php query_posts(‘cat=3’); ?>
    <!–the Loop–>(etc)
    </td>

    If you want it automated – you can’t really select which post to show. You can include in your query above to show only one post but that always will be the most recent.

    Thread Starter devils_advocate

    (@devils_advocate)

    ok.
    so…back to the original question.

    how do only show 1 post in the space?

    its not necessary to be automated.

    Thread Starter devils_advocate

    (@devils_advocate)

    would that be

    < ?php query_posts(‘cat=3’) showposts=1; ?>

    Thread Starter devils_advocate

    (@devils_advocate)

    no….maybe

    <?php query_posts(‘cat=3&showpost=1’); ?>

    ?

    Thread Starter devils_advocate

    (@devils_advocate)

    no that’s not it either…..hmmm

    anyone?

    Thread Starter devils_advocate

    (@devils_advocate)

    Got it….

    <?php query_posts(‘cat=3&showposts=1’); ?>

    thank moshu.

    Good that you figured out. Actually, you don’t nedd to guess:
    http://codex.wordpress.org/Template_Tags/query_posts

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Query specific time period for post to show’ is closed to new replies.