您可以使用WP_Date_Query 结合WP_Query 为了实现这一点。
$query = new \\WP_Query( array(
\'posts_per_page\' => 5,
\'date_query\' => array(
array(
\'day\' => date( \'j\', current_time( \'timestamp\' ) ),
\'month\' => date( \'n\', current_time( \'timestamp\' ) ),
\'before\' => \'this year\'
)
)
) );
if ( $query->have_posts() ) :
while ( $query->have_posts() ) : $query->the_post();
// Do stuff.
endwhile;
endif;