DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.

On some cases, you might want to be able to load and display all the posts from the current week. Here is a handy code snippet to do it easily.

Simply paste the code below where you’d like to load posts from the current week. Then don’t forget to display the results as desired.

$query_args = array(
	'w'    => date( 'W' ),
	'year' => date( 'Y' ),
$posts = get_posts( $query_args );

// display posts as desired

Thanks to Christian Brückner for the tip!

Leave a Comment

Your email address will not be published. Required fields are marked *