WordPress自定义文章类型归档页标题函数:post_type_archive_title - 利剑分享-科技生活-利剑分享-科技生活
利剑分享-科技生活-利剑分享-科技生活
利剑分享-科技生活

WordPress自定义文章类型归档页标题函数:post_type_archive_title

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
喜欢就支持一下吧
点赞11 分享

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'uos_print_tracking_script' not found or invalid function name in /www/wwwroot/flybace.com/wp-includes/class-wp-hook.php on line 324