
如何在WordPress文章和页面上显示最近更新日期
is_page ( $page = '' )
is_page: 该函数检查当前页面是否是WordPress页面。
确定查询是否是针对现有的单一页面。
如果指定了$page参数,这个函数将额外检查查询是否为指定的页面之一。
关于这个和类似的主题函数的更多信息,请查看《主题开发者手册》中的{@link Conditional Tags}文章。
function is_page( $page = '' ) { 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_page( $page ); }