in_the_loop

函数
in_the_loop ( No parameters )
返回值
  • (bool) True if caller is within loop, false if loop hasn't started or ended.
定义位置
相关方法
wp_find_hierarchy_loopsignup_another_bloginstall_themes_upload_n_noopget_theme_root
引入
2.0.0
弃用
-

in_the_loop: 这是一个确定当前WordPress循环是否正在执行的函数。如果循环正在执行,则返回true,否则返回false。

判断调用器是否在循环中。

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

function in_the_loop() {
	global $wp_query;

	if ( ! isset( $wp_query ) ) {
		return false;
	}

	return $wp_query->in_the_loop;
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-05 18:32:58

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: