on my WPWeekly.net website, I am currently having to set the number of posts to show manually in the Setup->Reading.
Is there a snippet that will let me have the home page blog show only the current week’s posts automatically?
Thanks!
on my WPWeekly.net website, I am currently having to set the number of posts to show manually in the Setup->Reading.
Is there a snippet that will let me have the home page blog show only the current week’s posts automatically?
Thanks!
You must be logged in to post a comment.
According to docs you can retrieve such set of posts by using Time Parameters with
query_posts()
, but note that it will likely horribly break your pagination and links to older entries.I guess i’m not really following Rarst’s concerns regarding paging and prev/next linking, i think you can safely intercept the home page query and change the query vars to look at posts within a specific time range, i tend to favour the filter/action approach(no need to setup paging values).
Paging works and the posts are within the specific range, but let me know if you have any problems with the code.
I hired an offshore developer to apply what I wanted, the previous week’s posts on a home page to a Thematic themed site. In retrospect, I should have asked him to apply two weeks (current week + this week):
You can download the theme here if you want to check it out…
http://dl.dropbox.com/u/4016505/thematic-wpweekly.net.zip
But here’s what he did (in his words) – hopes it makes some sense…
}