What Does the Title Attribute Mean in WordPress?
In WordPress, the title attribute can refer to several different features, depending on the context. These include the overall title element for the site, the HTML title attribute, and the function reference that is sometimes used in the WordPress Loop. Each of these features can be used to customize your WordPress blog in terms of usability for your visitors, and in terms of optimizing your posts for search engine positioning.
-
Meta Tag
-
The "Title" meta tag, technically called the "title element," gives a definition of a web page. The title meta tag is the string of text that appears at the very top of the browser, and also appears as the link to the page in search engine results. The title tag plays a strong role in search engine optimization, and it is common for keywords relating to the web page to be included in it, as well as the brand name of the site.
HTML Title Attribute
-
In HTML code, the title attribute is used to provide additional information about an object on a web page. This is the text that appears when a user hovers his mouse over an object, and gives supplementary information about what this object does or where it will take him. The format for a HTML title attribute is: title="value". So for a hyperlink, the format would be as follows:
<a href="http://example.com/" title="example of a title attribute">
-
Function Reference
-
A number of function references are available in WordPress to call different information into the WordPress loop. One such piece of information is the title of the post, which is normally called by "the_title()". However "the_title_attribute()" can also be used, with the advantage that it strips HTML tags and returns their associated character entity. Effectively, this means that, if the post title contains a character normally used in HTML code, such as triangular parentheses, it will still display correctly.
Default Settings and Customization
-
In the default WordPress theme, title tags display the post title and blog title. This can be modified manually in "header.php" in the Theme Editor, or with a plugin like "Custom Title Tags." By default, HTML title tags are only used by default in menu functions, and additional code must be added to "function.php" to override this. By default, "the_title" is used over "the_title_attribute()" and this can be changed in the theme editor.
-
References
- Photo Credit Jupiterimages/Comstock/Getty Images