function blog_page_title($before = '<h1 class="page-title">', $after = '</h1>', $blog_page_id = 0, $echo = true) { $blog_page_id = blog_page_id(); $blog_page_title = get_the_title($blog_page_id); if (!empty($blog_page_id)) { $blog_page_title = $before . $blog_page_title . $after; } if (!$echo) { return $blog_page_title; } echo $blog_page_title; }
* * @package pgb */ ?> <div class="col-md-12"> <?php if (is_front_page()) { printf('<h1 class="page-title">%s</h1>', get_bloginfo('name')); printf('<h3 class="page-sub-title">%s</h3>', get_bloginfo('description')); } elseif (is_single() || is_page()) { the_title('<h1 class="page-title">', '</h1>'); the_subtitle('<h3 class="page-sub-title">', '</h3>'); } elseif (is_blog_page()) { blog_page_title(); get_the_subtitle(blog_page_id(), '<h3 class="page-sub-title">', '</h3>', true); } elseif (is_search()) { printf('<h1 class="page-title">%s%s</h1>', __('Search Results for: ', 'pgb'), '<span>' . get_search_query() . '</span>'); } elseif (is_archive()) { if (is_category()) { printf('<h1 class="page-title">%s</h1>', single_cat_title('', false)); } elseif (is_tag()) { printf('<h1 class="page-title">%s</h1>', single_tag_title('', false)); } elseif (is_author()) { /* Queue the first post, that way we know * what author we're dealing with (if that is the case). */ the_post(); printf('<h1 class="page-title">%s%s</h1>', __('Author: ', 'pgb'), '<span class="vcard">' . get_the_author() . '</span>'); /* Since we called the_post() above, we need to * rewind the loop back to the beginning that way