Changeset 35300 for trunk/src/wp-includes/general-template.php
- Timestamp:
- 10/20/2015 06:30:59 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r35298 r35300 814 814 ); 815 815 816 // If on the home or front page, use the site title. 816 817 if ( is_home() && is_front_page() ) { 817 818 $title['title'] = get_bloginfo( 'name', 'display' ); 818 819 819 820 * If we're on the blog page and that page is not the homepage or a single page that is designated as821 *the homepage, use the container page's title.822 820 /* 821 * If we're on the blog page and that page is not the homepage or a single 822 * page that is designated as the homepage, use the container page's title. 823 */ 823 824 } elseif ( ( is_home() && ! is_front_page() ) || ( ! is_home() && is_front_page() ) ) { 824 825 $title['title'] = single_post_title( '', false ); 825 826 826 // If we're on a post / page.827 // If on a single post of any post type, use the post title. 827 828 } elseif ( is_singular() ) { 828 829 $title['title'] = single_post_title( '', false ); 829 830 830 // If we're on a category or tag or taxonomy archive.831 // If on a category or tag or taxonomy archive, use the archive title. 831 832 } elseif ( is_category() || is_tag() || is_tax() ) { 832 833 $title['title'] = single_term_title( '', false ); 833 834 834 // If it's a search.835 // If it's a search, use a dynamic search results title. 835 836 } elseif ( is_search() ) { 836 837 /* translators: %s: search phrase */ 837 838 $title['title'] = sprintf( __( 'Search Results for “%s”' ), get_search_query() ); 838 839 839 // If we're on an author archive.840 // If on an author archive, use the author's display name. 840 841 } elseif ( is_author() && $author = get_queried_object() ) { 841 842 $title['title'] = $author->display_name; 842 843 843 // If we're on a post type archive.844 // If on a post type archive, use the post type archive title. 844 845 } elseif ( is_post_type_archive() ) { 845 846 $title['title'] = post_type_archive_title( '', false ); 846 847 847 // If it's a date archive.848 // If it's a date archive, use the date as the title. 848 849 } elseif ( is_year() ) { 849 850 $title['title'] = get_the_date( _x( 'Y', 'yearly archives date format' ) ); … … 855 856 $title['title'] = get_the_date(); 856 857 857 // If it's a 404 page.858 // If it's a 404 page, use a "Page not found" title. 858 859 } elseif ( is_404() ) { 859 860 $title['title'] = __( 'Page not found' );
Note: See TracChangeset
for help on using the changeset viewer.