Skip to content

Instantly share code, notes, and snippets.

@talentedaamer
Last active November 24, 2015 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talentedaamer/81574d819c34fe3fd2de to your computer and use it in GitHub Desktop.
Save talentedaamer/81574d819c34fe3fd2de to your computer and use it in GitHub Desktop.
Right way to use <title> tags in WordPress themes. add_theme_support( 'title-tag' );
<?php
/*
* call the oopthemes_after_setup function when theme is initialized.
*/
add_action( 'after_setup_theme', 'oopthemes_after_setup' );
function oopthemes_after_setup() {
/**
* Add support for the <title> tags.
* @since WordPress 4.1
*/
add_theme_support( 'title-tag' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment