WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] HOWTO: Show a post for only 5 days

[Resolved] HOWTO: Show a post for only 5 days

  • My index page has two loops. The first loop only shows one post from one category, sort of a sticky post implementation. My question is how can I have this post show for only a certain amout of time, say 5 days.

    Here’s my query:

    WP_Query('category_name=news&showposts=1')

    So basically I want to use some logic to only show the post if its date falls within the last 5 days.

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] HOWTO: Show a post for only 5 days’ is closed to new replies.
Skip to toolbar