twentytwelve_wp_title

Creates a nicely formatted and more specific title element text for output in head of document, based on current view.

Description

twentytwelve_wp_title( $title, $sep ); 

Parameters (2)

0. $title
The title.
1. $sep
The sep.

Usage

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

Defined (1)

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

/functions.php  
  1. function twentytwelve_wp_title( $title, $sep ) { 
  2. global $paged, $page; 
  3.  
  4. if ( is_feed() ) 
  5. return $title; 
  6.  
  7. // Add the site name. 
  8. $title .= get_bloginfo( 'name' ); 
  9.  
  10. // Add the site description for the home/front page. 
  11. $site_description = get_bloginfo( 'description', 'display' ); 
  12. if ( $site_description && ( is_home() || is_front_page() ) ) 
  13. $title = "$title $sep $site_description"; 
  14.  
  15. // Add a page number if necessary. 
  16. if ( $paged >= 2 || $page >= 2 ) 
  17. $title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) ); 
  18.  
  19. return $title;