mh_magazine_lite_page_title

The MH Magazine lite mh magazine lite page title function.

Description

mh_magazine_lite_page_title(); 

Usage

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

Defined (1)

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

/includes/mh-compatibility.php  
  1. function mh_magazine_lite_page_title() { 
  2. if (!is_front_page()) { 
  3. echo '<header class="page-header">' . "\n"; 
  4. echo '<h1 class="page-title">'; 
  5. if (is_archive()) { 
  6. if (is_category() || is_tax()) { 
  7. single_cat_title(); 
  8. } elseif (is_tag()) { 
  9. single_tag_title(); 
  10. } elseif (is_author()) { 
  11. global $author; 
  12. $user_info = get_userdata($author); 
  13. printf(esc_html(_x('Articles by %s', 'post author', 'mh-magazine-lite')), esc_attr($user_info->display_name)); 
  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_post_type_archive()) { 
  21. global $post; 
  22. $post_type = get_post_type_object(get_post_type($post)); 
  23. echo esc_attr($post_type->labels->name); 
  24. } else { 
  25. esc_html_e('Archives', 'mh-magazine-lite'); 
  26. } else { 
  27. if (is_home()) { 
  28. echo esc_attr(get_the_title(get_option('page_for_posts', true))); 
  29. } elseif (is_404()) { 
  30. esc_html_e('Page not found (404)', 'mh-magazine-lite'); 
  31. } elseif (is_search()) { 
  32. printf(esc_html__('Search Results for %s', 'mh-magazine-lite'), esc_attr(get_search_query())); 
  33. } else { 
  34. the_title(); 
  35. echo '</h1>' . "\n"; 
  36. echo '</header>' . "\n";