function thesis_output_title() { // Is an SEO title tag plugin already being used? If so, defer to it to prevent conflict. if (function_exists('seo_title_tag')) { seo_title_tag(); } else { global $post; global $thesis; $site_name = get_bloginfo('name'); $separator = thesis_title_separator($thesis['head']); if (is_home() || is_front_page()) { // Allow for custom home pages to have completely custom <title> tag, like pages and posts if (get_option('show_on_front') == 'page' && is_front_page()) { $title_override = strip_tags(stripslashes(get_post_meta($post->ID, 'thesis_title', true))); } elseif (get_option('show_on_front') == 'page' && is_home()) { $title_override = strip_tags(stripslashes(get_post_meta(get_option('page_for_posts'), 'thesis_title', true))); } if (!$title_override) { $site_tagline = get_bloginfo('description'); if ($thesis['head']['title']['tagline'] && $thesis['head']['title']['tagline_first']) { echo "{$site_tagline} {$separator} {$site_name}"; } elseif ($thesis['head']['title']['title'] && $thesis['head']['title']['tagline']) { echo "{$site_name} {$separator} {$site_tagline}"; } elseif ($thesis['head']['title']['tagline']) { echo $site_tagline; } else { echo $site_name; } } else { echo $title_override; } } elseif (is_category()) { $category_description = trim(strip_tags(category_description())); $category_title = strlen($category_description) ? $category_description : single_cat_title(); if ($thesis['head']['title']['branded']) { echo "{$category_title} {$separator} {$site_name}"; } else { echo $category_title; } } elseif (is_search()) { $search_title = __('You searched for', 'thesis') . ' “' . attribute_escape(get_search_query()) . '”'; if ($thesis['head']['title']['branded']) { echo "{$search_title} {$separator} {$site_name}"; } else { echo $search_title; } } else { $custom_title = is_single() || is_page() ? get_post_meta($post->ID, 'thesis_title', true) : false; $page_title = $custom_title ? strip_tags(stripslashes($custom_title)) : trim(wp_title('', false)); if ($thesis['head']['title']['branded']) { echo "{$page_title} {$separator} {$site_name}"; } else { echo $page_title; } } if (is_home() || is_archive() || is_search()) { $current_page = get_query_var('paged'); if ($current_page > 1) { echo " {$separator} " . __('Page', 'thesis') . " {$current_page}"; } } } }
?> </p> <ul class="add_margin"> <li><input type="checkbox" id="head[title][branded]" name="head[title][branded]" value="1" <?php if ($head['title']['branded']) { echo 'checked="checked" '; } ?> /><label for="head[title][branded]"><?php _e('Append site name to page titles', 'thesis'); ?> </label></li> </ul> <p class="form_input add_margin"> <input type="text" class="text_input" id="head[title][separator]" name="head[title][separator]" value="<?php echo thesis_title_separator($head); ?> " /> <label for="head[title][separator]"><?php _e('Character separator in titles (where applicable)', 'thesis'); ?> </label> </p> <p class="tip"><?php _e('You can tweak the titles on your category archive pages by editing the <em>Description</em> field for your respective categories.', 'thesis'); ?> </p> </div> </div> <div class="module_subsection"> <h4><a href="" title="<?php