Created
August 30, 2019 14:40
-
-
Save pixelbart/ed4366b0d9b300c8a78102a869bdf2a8 to your computer and use it in GitHub Desktop.
Change the title tag of WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Custom title tag in WordPress | |
| * | |
| * @author Kevin Pliester | |
| */ | |
| /** | |
| * Set custom title | |
| * | |
| * @param string $title default title. | |
| * | |
| * @return array | |
| */ | |
| function custom_title( $title ) { | |
| return $title; | |
| } | |
| /** | |
| * Init custom title | |
| */ | |
| add_filter( 'pre_get_document_title', [ $this, 'custom_title' ], PHP_INT_MAX, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment