WordPress自定义文章类型归档页标题函数:post_type_archive_title
WordPress函数post_type_archive_title用于在自定义文章类型归档页输出标题,通常在archive-{$post_type}.php模板中使用。
post_type_archive_title( string $prefix = '', bool $display = true )
函数参数
$prefix
字符串
在标题前输出的内容
$display
布尔值,默认值:true
是否直接输出标题,false则只返回结果。
函数使用示例
<h1><?php post_type_archive_title(); ?></h1>
扩展阅读
post_type_archive_title()函数位于:wp-includes/general-template.php
相关函数:
- is_post_type_archive()
- wp_get_document_title()
- get_the_archive_title()
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END