Fix title function.

git-svn-id: https://develop.svn.wordpress.org/trunk@653 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2003-12-27 18:37:30 +00:00
parent 0c44a67568
commit 3b7c3e22d1
1 changed files with 5 additions and 3 deletions

View File

@ -77,8 +77,10 @@ function wp_title($sep = '»', $display = true) {
global $year, $monthnum, $day, $cat, $p, $name;
// If there's a category
if(!empty($cat) || !empty($category_name)) {
if(!empty($cat)) {
$title = stripslashes(get_the_category_by_ID($cat));
}
if (!empty($category_name)) {
$title = stripslashes($wpdb->get_var("SELECT cat_name FROM $tablecategories WHERE category_nicename = '$category_name'"));
}
@ -124,9 +126,9 @@ function wp_title($sep = '»', $display = true) {
}
// Send it out
if ($display) {
if ($display && $title) {
echo " $sep $title";
} else {
} elseif (!$display && $title) {
return " $sep $title";
}
}