/** * bf_document_title() - Document Title Function * * Prints out SEO optimized document title based on the page the user is in. * * @hook filter bf_document_title * @uses bf_get_page_no() * @since 0.5.2 */ function bf_document_title() { global $s; $output = ''; if (function_exists('seo_title_tag')) { seo_title_tag(); return null; } else { if (class_exists('All_in_One_SEO_Pack') || class_exists('HeadSpace2_Admin')) { if (is_front_page() || is_home()) { echo get_bloginfo('name') . ': ' . get_bloginfo('description'); $output = get_bloginfo('name') . ': ' . get_bloginfo('description'); } else { $output = wp_title('', false); } } else { if (is_attachment()) { $output = get_bloginfo('name') . ' | ' . single_post_title('', false); } else { if (is_single()) { $output = single_post_title('', false); } else { if (is_home()) { $output = get_bloginfo('name') . ' | ' . get_bloginfo('description') . bf_get_page_no(); } else { if (is_page()) { $output = single_post_title('', false); } else { if (is_search()) { $output = get_bloginfo('name') . ' | ' . sprintf(__('Search results for %s', 'arras'), wp_specialchars($s)) . bf_get_page_no(); } else { if (is_404()) { $output = get_bloginfo('name') . ' | ' . __('Not Found', 'arras'); } else { $output = get_bloginfo('name') . wp_title('|', false) . bf_get_page_no(); } } } } } } } } echo apply_filters('bf_document_title', $output); }
/** * @return string */ function document_title() { global $s; if (function_exists('seo_title_tag')) { seo_title_tag(); return null; } else { if (class_exists('All_in_One_SEO_Pack') || class_exists('Platinum_SEO_Pack') || class_exists('WPSEO_Frontend')) { if (is_front_page() || is_home()) { $output = get_bloginfo('name') . ' — ' . get_bloginfo('description'); } else { $output = wp_title('', false); } } else { if (is_attachment()) { $output = get_bloginfo('name') . ' — ' . single_post_title('', false); } else { if (is_single()) { $output = single_post_title('', false); } else { if (is_home()) { $output = get_bloginfo('name') . ' — ' . get_bloginfo('description'); } else { if (is_page()) { $output = single_post_title('', false); } else { if (is_search()) { $output = get_bloginfo('name') . ' — ' . sprintf(__('Результаты поиска для: %s'), esc_html($s)); } else { if (is_404()) { $output = get_bloginfo('name') . ' — ' . __('Ничего не найдено.'); } else { $output = get_bloginfo('name') . wp_title('—', false); } } } } } } } } echo apply_filters('document_title', $output); }
function arras_document_title() { if (function_exists('seo_title_tag')) { seo_title_tag(); } else { if (class_exists('All_in_One_SEO_Pack') || class_exists('HeadSpace2_Admin')) { if (is_front_page() || is_home()) { echo get_bloginfo('name') . ': ' . get_bloginfo('description'); } else { wp_title(''); } } else { if (is_attachment()) { bloginfo('name'); print ' | '; single_post_title(''); } elseif (is_single()) { single_post_title(); } elseif (is_home()) { bloginfo('name'); print ' | '; bloginfo('description'); arras_get_page_no(); } elseif (is_page()) { single_post_title(''); } elseif (is_search()) { bloginfo('name'); print ' | Search results for ' . wp_specialchars($s); arras_get_page_no(); } elseif (is_404()) { bloginfo('name'); print ' | Not Found'; } else { bloginfo('name'); wp_title('|'); arras_get_page_no(); } } } }
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?> > <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?> ; charset=<?php bloginfo('charset'); ?> " /> <meta name="author" content="Web Design Creatives" /> <title><?php if (function_exists('seo_title_tag')) { seo_title_tag(); } else { bloginfo('name'); wp_title(); } ?> </title> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?> " type="text/css" media="screen" /> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url');
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}"; } } } }