Filters the parts of the document title.
Parameters
$title
array- The document title parts.
title
stringTitle of the viewed page.page
stringOptional. Page number if paginated.tagline
stringOptional. Site description when on home page.site
stringOptional. Site title when not on home page.
Source
$title = apply_filters( 'document_title_parts', $title );
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |
Change the title for a specific page ID:
Make sure your add_filter() comes before the get_header() in your template file if you adding a title filter for that template file.
add_filter
in your template file. These kind of calls should live in your theme’sfunctions.php
file instead.