Get articles published by WordPress on that day

WordPress comment two hundred and eight Reading mode

Get a list of articles published by WordPress that day.

 Get the articles published by WordPress on that day - Picture 1

Get articles published by WordPress on that day

 <? php $today = getdate(); $args = array( 'posts_per_page'=>'20',//Number of articles 'ignore_sticky_posts' => true, 'date_query' => array( array( 'year'  => $today['year'], 'month' => $today['mon'], 'day'   => $today['mday'], ), ), ); $query = new WP_Query( $args ); ?> <ul> <? php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();?> <li> <? php the_title( sprintf( '<a class="title" href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a>' ); ?> </li> <? php endwhile;?> <? php wp_reset_postdata(); ?> <? php else : ?> <li> No update </li> <? php endif;?> </ul>
获取WordPress当日发布的文章-图片2
If you need to call WordPress articles within a certain period of time, you can do so through the following code.<? php $cat = '2'; // ...
one hundred and eighty-one
获取WordPress当日发布的文章-图片2
Get a list of WordPress articles published this week.<? php $args = array( 'posts_per_page'...
four hundred and forty four

Most of the articles on this site are original and used for personal learning records, which may be helpful to you, for reference only!

 weinxin
My Wechat
Copyright Notice
Please indicate the source and link of the original article reprinted on this site. Thank you for your cooperation!
five hundred and ninety-eight million eight hundred and forty-five thousand and six
 
 Robin
five hundred and ninety-eight million eight hundred and forty-five thousand and six
 anonymous

Comment

Anonymous netizens
 :?:  :razz:  :sad:  :evil:  :!:  :smile:  :oops:  :grin:  :eek:  :shock:  :???:  :cool:  :lol:  :mad:  :twisted:  :roll:  :wink:  :idea:  :arrow:  :neutral:  :cry:  :mrgreen:

Drag the slider to complete validation