the_title_attribute

Sponsored Link

現在の記事のタイトルを表示または返します。それは多少、the_title()の機能と重複しますが、HTMLタグを除去することによってタイトルの’clean’バージョンを提供して、文字エンティティに相当する特定の文字(引用符を含む)を変換します。

Sponsored Link

Displays or returns the title of the current post. It somewhat duplicates the functionality of the_title(), but provides a ‘clean’ version of the title by stripping HTML tags and converting certain characters (including quotes) to their character entity equivalent; it also uses query-string style parameters. This tag must be within The Loop.

the_title_attributeのテンプレートタグ使用方法

<?php the_title_attribute( $args ); ?> 

the_title_attributeのパラメーター

before

(string) (optional) テキストはタイトルの前に配置します。

(string) (optional) Text to place before the title.

Default: None

after

(string) (optional) テキストはタイトルの後に配置します。

(string) (optional) Text to place after the title.

Default: None

echo

(Boolean) (optional)タイトルをEchoあるいは、PHPで使用するためにそれを返します。

(Boolean) (optional) Echo the title or return it for use in PHP.

  • 1 – echo
  • 0 – return

Default: 1

<?php the_title_attribute('before=<h3>&amp;after='); ?>

注釈

  • See also: the_title().

変更ログ

Since: 2.3.0

ソースファイル

the_title_attribute()は、wp-includes/post-template.php内に位置しています。

the_title_attribute() is located in wp-includes/post-template.php.

関連テンプレートタグ

the_ID, the_title, the_title_attribute, single_post_title, the_title_rss, the_content, the_content_rss, the_excerpt, the_excerpt_rss, wp_link_pages, next_post_link, next_posts_link, previous_post_link, previous_posts_link, posts_nav_link, sticky_class, the_meta

Sponsored Link