From 738be91fcdd856318096c381b965d7d746d6c48d Mon Sep 17 00:00:00 2001 From: saxmatt Date: Sat, 27 Dec 2003 18:37:30 +0000 Subject: [PATCH] Fix title function. git-svn-id: http://svn.automattic.com/wordpress/trunk@653 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/template-functions.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/template-functions.php b/wp-includes/template-functions.php index 63d704923..02b1cc9f8 100644 --- a/wp-includes/template-functions.php +++ b/wp-includes/template-functions.php @@ -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"; } }