Posts tagged title tag
Dynamic Title in Wordpress
Nov 6th
If you’re not interested in changing your title tags on a post-to-post basis, then this is a good solution to show relevant titles to the page that the user is on.
<title> <?php if (is_home()) { echo bloginfo('name'); } elseif (is_404()) { echo '404 Not Found'; } elseif (is_category()) { echo 'Category:'; wp_title(''); } elseif (is_search()) { echo 'Search Results'; } elseif ( is_day() || is_month() || is_year() ) { echo 'Archives:'; wp_title(''); } else { echo wp_title(''); } ?> </title>
