Posted By

goatboy91587 on 07/06/10


Tagged

wordpress


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

manavecplan


WordPress Title PHP Snippet


 / Published in: PHP
 

URL: http://www.brettwidmann.com

Used in my post on how to optimize WordPress, which can be found here: http://www.brettwidmann.com/2010/01/optimizing-your-wordpress-site-pt-2/

  1. <title><?php if (is_home () )
  2. {
  3. bloginfo('name');
  4. }
  5.  
  6. elseif ( is_category() )
  7. {
  8. single_cat_title(); echo ' - ' ;
  9. bloginfo('name');
  10. }
  11.  
  12. elseif (is_single() )
  13. {
  14. single_post_title();
  15. }
  16.  
  17. elseif (is_page() )
  18. {
  19. bloginfo('name');
  20. echo ': ';
  21. single_post_title();
  22. }
  23.  
  24. else
  25. {
  26. wp_title('',true);
  27. } ?></title>

Report this snippet  

You need to login to post a comment.