is_comment_feed

函数
is_comment_feed ( No parameters )
返回值
  • (bool) Whether the query is for a comments feed.
定义位置
相关方法
post_comments_feed_linkcomments_link_feedcomment_idthe_content_feedget_comment_id
引入
3.0.0
弃用
-

is_comment_feed: 这个函数检查当前页面是否是一个评论源。评论源是一个显示特定文章评论的RSS源的页面。如果当前页面是一个评论源,它返回true,否则返回false。

查询的是评论feed吗?

function is_comment_feed() {
	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_comment_feed();
}

常见问题

FAQs
查看更多 >
闪电侠

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

2025-12-14 09:36:28

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

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

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