Query posts from current year

You just need get current date and add it on data_query in wp_query, Look this:

<?php 

$getdate = getdate();
$args = array(
    'date_query' => array(
        array(
            'year'  => $getdate["year"]
        ),
    ),
);
$query = new WP_Query( $args );

?>

and then use loop:

<?php 

if ( $query->have_posts() ): while ( $query->have_posts() ) : $query->the_post();

the_title();
the_content();

endwhile; endif;

?>

Leave a Comment