Changeset 35706 for trunk/src/wp-includes/general-template.php
- Timestamp:
- 11/19/2015 05:08:33 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/general-template.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r35700 r35706 848 848 ); 849 849 850 // If on the home or front page, use the site title. 851 if ( is_home() && is_front_page() ) { 852 $title['title'] = get_bloginfo( 'name', 'display' ); 853 854 /* 855 * If we're on the blog page and that page is not the homepage or a single 856 * page that is designated as the homepage, use the container page's title. 857 */ 858 } elseif ( ( is_home() && ! is_front_page() ) || ( ! is_home() && is_front_page() ) ) { 859 $title['title'] = single_post_title( '', false ); 860 861 // If on a single post of any post type, use the post title. 862 } elseif ( is_singular() ) { 863 $title['title'] = single_post_title( '', false ); 864 865 // If on a category or tag or taxonomy archive, use the archive title. 866 } elseif ( is_category() || is_tag() || is_tax() ) { 867 $title['title'] = single_term_title( '', false ); 850 // If it's a 404 page, use a "Page not found" title. 851 if ( is_404() ) { 852 $title['title'] = __( 'Page not found' ); 868 853 869 854 // If it's a search, use a dynamic search results title. … … 872 857 $title['title'] = sprintf( __( 'Search Results for “%s”' ), get_search_query() ); 873 858 874 // If on an author archive, use the author's display name.875 } elseif ( is_ author() ) {876 $title['title'] = get_ the_author();859 // If on the home or front page, use the site title. 860 } elseif ( is_home() && is_front_page() ) { 861 $title['title'] = get_bloginfo( 'name', 'display' ); 877 862 878 863 // If on a post type archive, use the post type archive title. … … 880 865 $title['title'] = post_type_archive_title( '', false ); 881 866 867 // If on a taxonomy archive, use the term title. 868 } elseif ( is_tax() ) { 869 $title['title'] = single_term_title( '', false ); 870 871 /* 872 * If we're on the blog page and that page is not the homepage or a single 873 * page that is designated as the homepage, use the container page's title. 874 */ 875 } elseif ( ( is_home() && ! is_front_page() ) || ( ! is_home() && is_front_page() ) ) { 876 $title['title'] = single_post_title( '', false ); 877 878 // If on a single post of any post type, use the post title. 879 } elseif ( is_singular() ) { 880 $title['title'] = single_post_title( '', false ); 881 882 // If on a category or tag archive, use the term title. 883 } elseif ( is_category() || is_tag() ) { 884 $title['title'] = single_term_title( '', false ); 885 886 // If on an author archive, use the author's display name. 887 } elseif ( is_author() && $author = get_queried_object() ) { 888 $title['title'] = $author->display_name; 889 882 890 // If it's a date archive, use the date as the title. 883 891 } elseif ( is_year() ) { … … 889 897 } elseif ( is_day() ) { 890 898 $title['title'] = get_the_date(); 891 892 // If it's a 404 page, use a "Page not found" title.893 } elseif ( is_404() ) {894 $title['title'] = __( 'Page not found' );895 899 } 896 900
Note: See TracChangeset
for help on using the changeset viewer.