Created
August 7, 2015 19:46
-
-
Save salmanbd96/a52cb6bc245e93fc1758 to your computer and use it in GitHub Desktop.
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
Adding this code to your wordpress theme will dynamically create a title. | |
<title><?php | |
if (is_home()) { echo bloginfo('name'); | |
} else if (is_404()) { | |
echo '404 Not Found'; | |
} else if (is_category()) { | |
echo 'Category:'; wp_title(''); | |
} else if (is_search()) { | |
echo 'Search Results'; | |
} else if ( is_day() || is_month() || is_year() ) { | |
echo 'Archives:'; wp_title(''); | |
} else { | |
echo wp_title(''); | |
} | |
?></title> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment