mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-05 18:32:23 +01:00
Fix title function.
git-svn-id: http://svn.automattic.com/wordpress/trunk@653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8d232849e3
commit
738be91fcd
@ -77,8 +77,10 @@ function wp_title($sep = '»', $display = true) {
|
|||||||
global $year, $monthnum, $day, $cat, $p, $name;
|
global $year, $monthnum, $day, $cat, $p, $name;
|
||||||
|
|
||||||
// If there's a category
|
// If there's a category
|
||||||
if(!empty($cat) || !empty($category_name)) {
|
if(!empty($cat)) {
|
||||||
$title = stripslashes(get_the_category_by_ID($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'"));
|
$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
|
// Send it out
|
||||||
if ($display) {
|
if ($display && $title) {
|
||||||
echo " $sep $title";
|
echo " $sep $title";
|
||||||
} else {
|
} elseif (!$display && $title) {
|
||||||
return " $sep $title";
|
return " $sep $title";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user