Title is the main label on a piece of information. In WP the term is mainly used to label a whole html page, a post, a widget or an attachment.
Title is the main label on a piece of information. In WP the term is mainly used to label a whole HTML page, a post, a widget or an attachment.
- The title of a whole HTML page page is wrapped in
<title>
tags. Since WP 4.1 usingadd_theme_support( 'title-tag' );
for this is recommended. - The title of a single post is included in a theme with
the_title
. - The title is the only standardized item within a widget. Its HTML properties are set when
register_sidebar
is set. The actual title is set by the widget itself. If the widget title is set in the standard way, it is possible to filter it. - Attachments (such as images to a post) are a special type of post and hence have titles to. These are set during the media upload process and be retrieved with
$attachment->post_title
, where$attachment
is the attachment object.