evolved_filter_wp_title

The Evolved evolved filter wp title function.

Description

evolved_filter_wp_title( $old_title, $sep, $sep_location ); 

Parameters (3)

0. $old_title
The old title.
1. $sep
The sep.
2. $sep_location
The sep location.

Usage

  1. if ( !function_exists( 'evolved_filter_wp_title' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4. // The old title. 
  5. $old_title = null; 
  6.  
  7. // The sep. 
  8. $sep = null; 
  9.  
  10. // The sep location. 
  11. $sep_location = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = evolved_filter_wp_title($old_title, $sep, $sep_location); 
  15.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function evolved_filter_wp_title( $old_title, $sep, $sep_location ) { 
  2.  
  3. // add padding to the sep 
  4. $ssep = ' ' . $sep . ' '; 
  5.  
  6. // find the type of index page this is 
  7. if( is_category() ) $insert = $ssep . __('Category', 'evolved'); 
  8. elseif( is_tag() ) $insert = $ssep . __('Tag', 'evolved'); 
  9. elseif( is_author() ) $insert = $ssep . __('Author', 'evolved'); 
  10. elseif( is_year() || is_month() || is_day() ) $insert = $ssep . __('Archives', 'evolved'); 
  11. elseif( is_home() ) $insert = $ssep . get_bloginfo('description'); 
  12. else $insert = NULL; 
  13.  
  14. // get the page number we're on (index) 
  15. if( get_query_var( 'paged' ) ) 
  16. $num = $ssep . __('Page ', 'evolved') . get_query_var( 'paged' ); 
  17.  
  18. // get the page number we're on (multipage post) 
  19. elseif( get_query_var( 'page' ) ) 
  20. $num = $ssep . __('Page ', 'evolved') . get_query_var( 'page' ); 
  21.  
  22. // else 
  23. else $num = NULL; 
  24.  
  25.  
  26. // concoct and return new title 
  27. return get_bloginfo( 'name' ) . $insert . $old_title . $num;