mh_page_title

The MH Purity lite mh page title function.

Description

mh_page_title(); 

Usage

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

Defined (1)

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

/includes/mh-functions.php  
  1. function mh_page_title() { 
  2. if (is_home()) { 
  3. echo get_the_title(get_option('page_for_posts', true)); 
  4. } elseif (is_author()) { 
  5. global $author; 
  6. $user_info = get_userdata($author); 
  7. echo __('Articles by ', 'mh-purity-lite') . esc_attr($user_info->display_name); 
  8. } elseif (is_category() || is_tax()) { 
  9. echo single_cat_title("", false); 
  10. } elseif (is_tag()) { 
  11. echo single_tag_title("", false); 
  12. } elseif (is_search()) { 
  13. echo __('Search Results for ', 'mh-purity-lite') . get_search_query(); 
  14. } elseif (is_day()) { 
  15. echo get_the_date(); 
  16. } elseif (is_month()) { 
  17. echo get_the_date('F Y'); 
  18. } elseif (is_year()) { 
  19. echo get_the_date('Y'); 
  20. } elseif (is_404()) { 
  21. echo __('Page not found (404)', 'mh-purity-lite'); 
  22. } else { 
  23. echo get_the_title();