otw_page_title

The Carbon Light - Business responsive otw page title function.

Description

otw_page_title(); 

Usage

  1. if ( !function_exists( 'otw_page_title' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = otw_page_title(); 
  7.  

Defined (1)

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

/functions.php  
  1. function otw_page_title() { 
  2.  
  3. if (is_category()) { 
  4. printf( __( 'Category: %s', 'otw-carbon-light' ), single_cat_title( '', false ) ); 
  5.  
  6. } elseif (is_tag()) { 
  7. printf( __( 'Tag: %s', 'otw-carbon-light' ), single_tag_title( '', false ) ); 
  8.  
  9. } elseif (is_tax()) { 
  10. printf( __( 'Archive for: %s', 'otw-carbon-light' ), single_tag_title( '', false ) ); 
  11.  
  12. } elseif (is_archive()) { 
  13.  
  14. if ( is_day() ) : 
  15. printf( __( 'Daily Archives: %s', 'otw-carbon-light' ), get_the_date() ); 
  16.  
  17. elseif ( is_month() ) : 
  18. printf( __( 'Monthly Archives: %s', 'otw-carbon-light' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'otw-carbon-light' ) ) ); 
  19.  
  20. elseif ( is_year() ) : 
  21. printf( __( 'Yearly Archives: %s', 'otw-carbon-light' ), get_the_date( _x( 'Y', 'yearly archives date format', 'otw-carbon-light' ) ) ); 
  22.  
  23. elseif ( is_author() ) : 
  24. _e( 'Author: ', 'otw-carbon-light' ); echo get_the_author_meta( 'display_name', get_query_var( 'author' ) ); 
  25.  
  26. else : 
  27. _e( 'Archives', 'otw-carbon-light' ); 
  28.  
  29. endif; 
  30.  
  31. } elseif( is_home() && get_option('page_for_posts') ) { 
  32. echo get_page( get_option('page_for_posts') )->post_title; // Posts Page setted 
  33.  
  34. } elseif( 'page' == get_option('show_on_front') ) { 
  35. the_title(); // Front Page setted 
  36.  
  37. } elseif (is_home() || is_front_page() ) { 
  38. _e( 'Recent Blog Posts', 'otw-carbon-light' ); // Front Page not setted 
  39.  
  40. } elseif (is_page() || is_single()) { 
  41. the_title(); 
  42.  
  43. } elseif (is_search()) { 
  44. printf( __( 'Search Results for: %s', 'otw-carbon-light' ), get_search_query() ); 
  45.  
  46. } elseif (!(is_404()) && (is_single()) || (is_page())) { 
  47. wp_title(''); echo ' - '; 
  48.  
  49. } elseif (is_404()) { 
  50. _e( '404 Page not found', 'otw-carbon-light' ); 
  51.  
  52.