首页 - 代码高亮

MNews 主题1.8版本的代码高亮功能,设置请前往萨龙网络文档

/*
* MNews 主题代码高亮功能
* 今日更新的文章数量
*/
function get_today_post_count(){
    $date_query = array(
        array(
            'after'=>'1 day ago'
        )
    );
    $args = array(
        'post_type'         => 'post',
        'post_status'       => 'publish',
        'date_query'        => $date_query,
        'no_found_rows'     => true,
        'suppress_filters'  => true,
        'fields'            => 'ids',
        'posts_per_page'    => -1
    );
    $query = new WP_Query( $args );
    return $query->post_count;
}