So, I’m using this in category.php
$query = new WP_Query( array(‘cat’ => $cat, ‘posts_per_page’ => 1, ‘offset’ => 3 ) );
this in search.php
$query = new WP_Query( array(‘s’ => get_search_query(), ‘posts_per_page’ => 1, ‘offset’ => 3 ) );
But I cannot find a way to do the same thing inside my archive.php, which I’m going to use only for dates.
For example, when you visit mysite.com/?m=201301 I need to query only the posts from this date range.
Is that possible?
- The topic ‘How to use WP_Query to get posts from date archive page’ is closed to new replies.