function thematic_doctitle() { $site_name = get_bloginfo('name'); $separator = '|'; if (is_single()) { $content = single_post_title('', FALSE); } elseif (is_home() || is_front_page()) { $content = get_bloginfo('description'); } elseif (is_page()) { $content = single_post_title('', FALSE); } elseif (is_search()) { $content = __('Search Results for:', 'thematic'); $content .= ' ' . esc_html(stripslashes(get_search_query())); } elseif (is_category()) { $content = __('Category Archives:', 'thematic'); $content .= ' ' . single_cat_title("", false); } elseif (is_tag()) { $content = __('Tag Archives:', 'thematic'); $content .= ' ' . thematic_tag_query(); } elseif (is_404()) { $content = __('Not Found', 'thematic'); } else { $content = get_bloginfo('description'); } if (get_query_var('paged')) { $content .= ' ' . $separator . ' '; $content .= 'Page'; $content .= ' '; $content .= get_query_var('paged'); } if ($content) { if (is_home() || is_front_page()) { $elements = array('site_name' => $site_name, 'separator' => $separator, 'content' => $content); } else { $elements = array('content' => $content); } } else { $elements = array('site_name' => $site_name); } // Filters should return an array $elements = apply_filters('thematic_doctitle', $elements); // But if they don't, it won't try to implode if (is_array($elements)) { $doctitle = implode(' ', $elements); } else { $doctitle = $elements; } $doctitle = "\t" . "<title>" . $doctitle . "</title>" . "\n\n"; echo $doctitle; }
function gallery_page_title($content) { if (is_category()) { $content = '<h1 class="page-title"><span>'; $content .= single_cat_title("", false); $content .= '</span></h1>'; if (!('' == category_description())) { $content .= '<div class="archive-meta">'; $content .= apply_filters('archive_meta', category_description()); $content .= '</div>'; } } elseif (is_tag()) { $content = '<h1 class="page-title"><span>'; $content = thematic_tag_query(); $content = '</span></h1>'; } return $content; }
function thematic_page_title() { $content = ''; if (is_attachment()) { $content .= '<h2 class="page-title"><a href="'; $content .= get_permalink($post->post_parent); $content .= '" rev="attachment"><span class="meta-nav">« </span>'; $content .= get_the_title($post->post_parent); $content .= '</a></h2>'; } elseif (is_author()) { $content .= '<h1 class="page-title author">'; $author = get_the_author(); $content .= __('Author Archives: ', 'thematic'); $content .= '<span>'; $content .= $author; $content .= '</span></h1>'; } elseif (is_category()) { $content .= '<h1 class="page-title">'; $content .= __('Category Archives:', 'thematic'); $content .= ' <span>'; $content .= single_cat_title('', FALSE); $content .= '</span></h1>' . "\n"; $content .= '<div class="archive-meta">'; if (!('' == category_description())) { $content .= apply_filters('archive_meta', category_description()); } $content .= '</div>'; } elseif (is_search()) { $content .= '<h1 class="page-title">'; $content .= __('Search Results for:', 'thematic'); $content .= ' <span id="search-terms">'; $content .= wp_specialchars(stripslashes($_GET['s']), true); $content .= '</span></h1>'; } elseif (is_tag()) { $content .= '<h1 class="page-title">'; $content .= __('Tag Archives:', 'thematic'); $content .= ' <span>'; $content .= __(thematic_tag_query()); $content .= '</span></h1>'; } elseif (is_day()) { $content .= '<h1 class="page-title">'; $content .= sprintf(__('Daily Archives: <span>%s</span>', 'thematic'), get_the_time(get_option('date_format'))); $content .= '</h1>'; } elseif (is_month()) { $content .= '<h1 class="page-title">'; $content .= sprintf(__('Monthly Archives: <span>%s</span>', 'thematic'), get_the_time('F Y')); $content .= '</h1>'; } elseif (is_year()) { $content .= '<h1 class="page-title">'; $content .= sprintf(__('Yearly Archives: <span>%s</span>', 'thematic'), get_the_time('Y')); $content .= '</h1>'; } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { $content .= '<h1 class="page-title">'; $content .= __('Blog Archives', 'thematic'); $content .= '</h1>'; } $content .= "\n"; echo apply_filters('thematic_page_title', $content); }
/** * Filters wp_title returning the doctitle contents * Located in header.php Credits: Tarski Theme * * Override: childtheme_override_doctitle * Filter: thematic_doctitle_separator * Filter: thematic_doctitle * * @since 1.0.2 */ function thematic_wptitle($wp_doctitle, $separator, $sep_location) { // return original string if on feed or if a seo plugin is being used if (is_feed() || !thematic_seo()) { return $wp_doctitle; } // otherwise... $site_name = get_bloginfo('name', 'display'); if (is_single() || is_home() && !is_front_page() || is_page() && !is_front_page()) { $content = single_post_title('', FALSE); } elseif (is_front_page()) { $content = get_bloginfo('description', 'display'); } elseif (is_page()) { $content = single_post_title('', FALSE); } elseif (is_search()) { $content = __('Search Results for:', 'thematic'); $content .= ' ' . get_search_query(); } elseif (is_category()) { $content = __('Category Archives:', 'thematic'); $content .= ' ' . single_cat_title('', FALSE); } elseif (is_tag()) { $content = __('Tag Archives:', 'thematic'); $content .= ' ' . thematic_tag_query(); } elseif (is_404()) { $content = __('Not Found', 'thematic'); } else { $content = get_bloginfo('description', 'display'); } if (get_query_var('paged')) { $content .= ' ' . $separator . ' '; $content .= 'Page'; $content .= ' '; $content .= get_query_var('paged'); } if ($content) { if (is_front_page()) { $elements = array('site_name' => $site_name, 'separator' => $separator, 'content' => $content); } else { $elements = array('content' => $content); } } else { $elements = array('site_name' => $site_name); } // Filters should return an array $elements = apply_filters('thematic_doctitle', $elements); // But if they don't, it won't try to implode if (is_array($elements)) { $thematic_doctitle = implode(' ', $elements); } else { $thematic_doctitle = $elements; } return $thematic_doctitle; }