Dynamic Title Tags


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <title><?phpif (is_home()) { echo bloginfo('name');
  2. } elseif (is_404()) {
  3. echo '404 Not Found';
  4. } elseif (is_category()) {
  5. echo 'Category:'; wp_title('');
  6. } elseif (is_search()) {
  7. echo 'Search Results';
  8. } elseif ( is_day() || is_month() || is_year() ) {
  9. echo 'Archives:'; wp_title('');
  10. } else {
  11. echo wp_title('');
  12. }
  13. ?></title>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.