WordPress判断是否指定文章类型归档页函数:is_post_type_archive

文 / @WordPress主题

WordPress函数is_post_type_archive用于判断是否指定的文章类型归档页。

is_post_type_archive( string|string[] $post_types = '' )

函数参数

$post_types

字符串

指定文章类型

函数使用示例

<?php if ( is_post_type_archive() ) { ?>
	<h1><?php post_type_archive_title(); ?></h1>
<?php } ?>

扩展阅读

is_post_type_archive()函数位于:wp-includes/query.php

相关函数:

  • get_the_archive_title()
  • get_the_archive_description()
  • wp_get_document_title()
  • post_type_archive_title()
添加UTHEME为好友
扫码添加UTHEME微信为好友
· 分享WordPress相关技术文章,主题上新与优惠动态早知道。
· 微信端最大WordPress社群,限时免费入群。