Needing to show archived posts from multiple months
-
I really would appreciate help with the following. I have added a template which collates pupil posts which is working great. However, I also want to add a second template which does the same but within a set timeframe – e.g., only display posts from January to June 2011. This would allow me to ‘freeze a report in time’.
This code does not work as I hoped it would:
$args = array( 'numberposts' => 3, 'tag'=> "mathtag", 'year' => 2011,'monthnum' => 1,2,3,4,5,6); $postsByTag = get_posts($args);
The monthnum part does not work. Replacing it with a single digit does work, but I need posts from across multiple months.
I also tried
$postsByTag = get_posts('tag=mathtag&numberposts=3&year=2011&monthnum=1,2,3,4,5,6');
but again this did not work. Any idea how I can select posts from across a range of months?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Needing to show archived posts from multiple months’ is closed to new replies.