Browse Source

Added filter for wp_title()

Instead of concatenating in the header, which some plugins might not
like.
master
Kondou 8 years ago
parent
commit
5126ad5257
2 changed files with 16 additions and 1 deletions
  1. +15
    -0
      functions.php
  2. +1
    -1
      header.php

+ 15
- 0
functions.php View File

@ -34,4 +34,19 @@ function kpress_search_form($form) {
return $form;
}
add_filter('get_search_form', 'kpress_search_form');
function kpress_title($title, $sep) {
if(is_feed())
return $title;
$title = get_bloginfo('name') . $title;
$site_description = get_bloginfo('description', 'display');
if ($site_description && (is_home() || is_front_page()))
$title = "$title $sep $site_description";
return $title;
}
add_filter('wp_title', 'kpress_title', 10, 2);
?>

+ 1
- 1
header.php View File

@ -1,7 +1,7 @@
<!DOCTYPE HTML>
<html <?php language_attributes(); ?>>
<head>
<title><?php bloginfo('name'); ?> – <?php is_home() ? bloginfo('description') : wp_title(); ?></title>
<title><?php wp_title("") ?></title>
<meta charset="<?php bloginfo('charset'); ?>">
<link rel="icon" type="image/png" href="favicon.png">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">