购买过本站ripro主题美化的非正版用户需要看一下

/**
* 资源统计
*/
require_once get_stylesheet_directory() . ‘/inc/admin/init.php’;
// 每周更新的文章数量
function get_week_post_count(){
$date_query = array(
array(
‘after’=>’1 week 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 );
echo $query->post_count;
}
// 每日更新的文章数量
function WeeklyUpdate() {
$today = getdate();
$query = new WP_Query( ‘year=’ . $today[“year”] . ‘&monthnum=’ . $today[“mon”] . ‘&day=’ . $today[“mday”]);
$postsNumber = $query->found_posts;
echo $postsNumber;
}
———-分割线————-
你要是使用的是非正版的主题那functions.php这个文件就不要覆盖到你的主题了。
把以上的代码复制到你的functions.php底下就可以了。