the_archive_title() - WordPress 函数参考中文文档

返回介绍

the_archive_title()

发布于 2017-09-11 字数1957 浏览 901 评论 0

the_archive_title( string $before = '',  string $after = '' )

Display the archive title based on the queried object.


描述


参数

$before

(string)
(Optional)
Content to prepend to the title.

Default value: ”

$after

(string)
(Optional)
Content to append to the title.

Default value: ”


源代码

File: wp-includes/general-template.php

function the_archive_title( $before = '', $after = '' ) {
	$title = get_the_archive_title();

	if ( ! empty( $title ) ) {
		echo $before . $title . $after;
	}
}

更新日志

Version 描述
4.1.0 Introduced.

相关函数

Uses

  • wp-includes/general-template.php:
    get_the_archive_title()

User Contributed Notes

  1. Skip to note content

    You must log in to vote on the helpfulness of this noteVote results for this note: 1You must log in to vote on the helpfulness of this note

    Contributed by Hugo Baeta

    Used for returning/displaying the title of the current term, date, post type, post format, or author archive.

  2. Display archive title.

    the_archive_title( '<h1 class="page-title">', '</h1>' );

    See Also

    the_archive_描述() – Display category, tag, term, or author 描述

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!