is_day

函数


is_day ( No parameters )
返回值
  • (bool) Whether the query is for an existing day archive.
定义位置
  • wp-includes/query.php
    , line 386
引入
1.5.0
弃用

判断查询是否为现有的一天的档案。

一个条件检查,以测试该页面是否是一个基于日期的档案页,显示当前一天的帖子。

关于这个和类似主题函数的更多信息,请查看《主题开发者手册》中的{@link Conditional Tags}文章。

function is_day() {
	global $wp_query;

	if ( ! isset( $wp_query ) ) {
		_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );
		return false;
	}

	return $wp_query->is_day();
}