Last active
July 19, 2021 16:33
-
-
Save meetbryce/850d11fe4e0741d45d54 to your computer and use it in GitHub Desktop.
Best Practice Wordpress Theme Title Code
This file contains 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
<title><?php | |
if (is_home () ) { echo sprintf('The %s Blog', get_bloginfo(‘name’)); } | |
elseif ( is_category() ) { single_cat_title(); echo ‘ - ‘ ; bloginfo(‘name’); } | |
elseif (is_single() ) { echo sprintf('%s – The %s Blog', single_post_title(false), get_bloginfo(‘name’));} | |
elseif (is_page() ) { single_post_title();} | |
else { wp_title('',true); echo sprintf(' Blog – %s', get_bloginfo(‘name’));} | |
?></title> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment