| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
function get_header( $name = null ) { |
|---|
| 26 |
do_action( 'get_header' ); |
|---|
| 27 |
|
|---|
| 28 |
$templates = array(); |
|---|
| 29 |
if ( isset($name) ) |
|---|
| 30 |
$templates[] = "header-{$name}.php"; |
|---|
| 31 |
|
|---|
| 32 |
$templates[] = "header.php"; |
|---|
| 33 |
|
|---|
| 34 |
if ('' == locate_template($templates, true)) |
|---|
| 35 |
load_template( get_theme_root() . '/default/header.php'); |
|---|
| 36 |
} |
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
function get_footer( $name = null ) { |
|---|
| 55 |
do_action( 'get_footer' ); |
|---|
| 56 |
|
|---|
| 57 |
$templates = array(); |
|---|
| 58 |
if ( isset($name) ) |
|---|
| 59 |
$templates[] = "footer-{$name}.php"; |
|---|
| 60 |
|
|---|
| 61 |
$templates[] = "footer.php"; |
|---|
| 62 |
|
|---|
| 63 |
if ('' == locate_template($templates, true)) |
|---|
| 64 |
load_template( get_theme_root() . '/default/footer.php'); |
|---|
| 65 |
} |
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 |
function get_sidebar( $name = null ) { |
|---|
| 84 |
do_action( 'get_sidebar' ); |
|---|
| 85 |
|
|---|
| 86 |
$templates = array(); |
|---|
| 87 |
if ( isset($name) ) |
|---|
| 88 |
$templates[] = "sidebar-{$name}.php"; |
|---|
| 89 |
|
|---|
| 90 |
$templates[] = "sidebar.php"; |
|---|
| 91 |
|
|---|
| 92 |
if ('' == locate_template($templates, true)) |
|---|
| 93 |
load_template( get_theme_root() . '/default/sidebar.php'); |
|---|
| 94 |
} |
|---|
| 95 |
|
|---|
| 96 |
|
|---|
| 97 |
|
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 |
|
|---|
| 104 |
|
|---|
| 105 |
function get_search_form() { |
|---|
| 106 |
do_action( 'get_search_form' ); |
|---|
| 107 |
|
|---|
| 108 |
if ( '' != locate_template(array('searchform.php'), true) ) |
|---|
| 109 |
return; |
|---|
| 110 |
|
|---|
| 111 |
$form = '<form method="get" id="searchform" action="' . get_option('siteurl') . '/" > |
|---|
| 112 |
<label class="hidden" for="s">' . __('Search for:') . '</label> |
|---|
| 113 |
<div><input type="text" value="' . the_search_query() . '" name="s" id="s" /> |
|---|
| 114 |
<input type="submit" id="searchsubmit" value="Search" /> |
|---|
| 115 |
</div> |
|---|
| 116 |
</form>'; |
|---|
| 117 |
|
|---|
| 118 |
echo apply_filters('get_search_form', $form); |
|---|
| 119 |
} |
|---|
| 120 |
|
|---|
| 121 |
|
|---|
| 122 |
|
|---|
| 123 |
|
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 |
|
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 |
function wp_loginout() { |
|---|
| 131 |
if ( ! is_user_logged_in() ) |
|---|
| 132 |
$link = '<a href="' . wp_login_url() . '">' . __('Log in') . '</a>'; |
|---|
| 133 |
else |
|---|
| 134 |
$link = '<a href="' . wp_logout_url() . '">' . __('Log out') . '</a>'; |
|---|
| 135 |
|
|---|
| 136 |
echo apply_filters('loginout', $link); |
|---|
| 137 |
} |
|---|
| 138 |
|
|---|
| 139 |
|
|---|
| 140 |
|
|---|
| 141 |
|
|---|
| 142 |
|
|---|
| 143 |
|
|---|
| 144 |
|
|---|
| 145 |
|
|---|
| 146 |
|
|---|
| 147 |
|
|---|
| 148 |
|
|---|
| 149 |
|
|---|
| 150 |
function wp_logout_url($redirect = '') { |
|---|
| 151 |
if ( strlen($redirect) ) |
|---|
| 152 |
$redirect = "&redirect_to=$redirect"; |
|---|
| 153 |
|
|---|
| 154 |
return wp_nonce_url( site_url("wp-login.php?action=logout$redirect", 'login'), 'log-out' ); |
|---|
| 155 |
} |
|---|
| 156 |
|
|---|
| 157 |
|
|---|
| 158 |
|
|---|
| 159 |
|
|---|
| 160 |
|
|---|
| 161 |
|
|---|
| 162 |
|
|---|
| 163 |
|
|---|
| 164 |
|
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 |
function wp_login_url($redirect = '') { |
|---|
| 168 |
if ( strlen($redirect) ) |
|---|
| 169 |
$redirect = "?redirect_to=$redirect"; |
|---|
| 170 |
|
|---|
| 171 |
return site_url("wp-login.php$redirect", 'login'); |
|---|
| 172 |
} |
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 |
|
|---|
| 176 |
|
|---|
| 177 |
|
|---|
| 178 |
|
|---|
| 179 |
|
|---|
| 180 |
|
|---|
| 181 |
|
|---|
| 182 |
|
|---|
| 183 |
|
|---|
| 184 |
|
|---|
| 185 |
|
|---|
| 186 |
function wp_register( $before = '<li>', $after = '</li>' ) { |
|---|
| 187 |
|
|---|
| 188 |
if ( ! is_user_logged_in() ) { |
|---|
| 189 |
if ( get_option('users_can_register') ) |
|---|
| 190 |
$link = $before . '<a href="' . site_url('wp-login.php?action=register', 'login') . '">' . __('Register') . '</a>' . $after; |
|---|
| 191 |
else |
|---|
| 192 |
$link = ''; |
|---|
| 193 |
} else { |
|---|
| 194 |
$link = $before . '<a href="' . admin_url() . '">' . __('Site Admin') . '</a>' . $after; |
|---|
| 195 |
} |
|---|
| 196 |
|
|---|
| 197 |
echo apply_filters('register', $link); |
|---|
| 198 |
} |
|---|
| 199 |
|
|---|
| 200 |
|
|---|
| 201 |
|
|---|
| 202 |
|
|---|
| 203 |
|
|---|
| 204 |
|
|---|
| 205 |
|
|---|
| 206 |
|
|---|
| 207 |
|
|---|
| 208 |
|
|---|
| 209 |
|
|---|
| 210 |
function wp_meta() { |
|---|
| 211 |
do_action('wp_meta'); |
|---|
| 212 |
} |
|---|
| 213 |
|
|---|
| 214 |
|
|---|
| 215 |
|
|---|
| 216 |
|
|---|
| 217 |
|
|---|
| 218 |
|
|---|
| 219 |
|
|---|
| 220 |
|
|---|
| 221 |
|
|---|
| 222 |
function bloginfo($show='') { |
|---|
| 223 |
echo get_bloginfo($show, 'display'); |
|---|
| 224 |
} |
|---|
| 225 |
|
|---|
| 226 |
|
|---|
| 227 |
|
|---|
| 228 |
|
|---|
| 229 |
|
|---|
| 230 |
|
|---|
| 231 |
|
|---|
| 232 |
|
|---|
| 233 |
|
|---|
| 234 |
|
|---|
| 235 |
|
|---|
| 236 |
|
|---|
| 237 |
|
|---|
| 238 |
|
|---|
| 239 |
|
|---|
| 240 |
|
|---|
| 241 |
|
|---|
| 242 |
|
|---|
| 243 |
|
|---|
| 244 |
|
|---|
| 245 |
|
|---|
| 246 |
|
|---|
| 247 |
|
|---|
| 248 |
|
|---|
| 249 |
|
|---|
| 250 |
|
|---|
| 251 |
|
|---|
| 252 |
|
|---|
| 253 |
|
|---|
| 254 |
|
|---|
| 255 |
function get_bloginfo($show = '', $filter = 'raw') { |
|---|
| 256 |
|
|---|
| 257 |
switch($show) { |
|---|
| 258 |
case 'url' : |
|---|
| 259 |
case 'home' : |
|---|
| 260 |
case 'siteurl' : |
|---|
| 261 |
$output = get_option('home'); |
|---|
| 262 |
break; |
|---|
| 263 |
case 'wpurl' : |
|---|
| 264 |
$output = get_option('siteurl'); |
|---|
| 265 |
break; |
|---|
| 266 |
case 'description': |
|---|
| 267 |
$output = get_option('blogdescription'); |
|---|
| 268 |
break; |
|---|
| 269 |
case 'rdf_url': |
|---|
| 270 |
$output = get_feed_link('rdf'); |
|---|
| 271 |
break; |
|---|
| 272 |
case 'rss_url': |
|---|
| 273 |
$output = get_feed_link('rss'); |
|---|
| 274 |
break; |
|---|
| 275 |
case 'rss2_url': |
|---|
| 276 |
$output = get_feed_link('rss2'); |
|---|
| 277 |
break; |
|---|
| 278 |
case 'atom_url': |
|---|
| 279 |
$output = get_feed_link('atom'); |
|---|
| 280 |
break; |
|---|
| 281 |
case 'comments_atom_url': |
|---|
| 282 |
$output = get_feed_link('comments_atom'); |
|---|
| 283 |
break; |
|---|
| 284 |
case 'comments_rss2_url': |
|---|
| 285 |
$output = get_feed_link('comments_rss2'); |
|---|
| 286 |
break; |
|---|
| 287 |
case 'pingback_url': |
|---|
| 288 |
$output = get_option('siteurl') .'/xmlrpc.php'; |
|---|
| 289 |
break; |
|---|
| 290 |
case 'stylesheet_url': |
|---|
| 291 |
$output = get_stylesheet_uri(); |
|---|
| 292 |
break; |
|---|
| 293 |
case 'stylesheet_directory': |
|---|
| 294 |
$output = get_stylesheet_directory_uri(); |
|---|
| 295 |
break; |
|---|
| 296 |
case 'template_directory': |
|---|
| 297 |
case 'template_url': |
|---|
| 298 |
$output = get_template_directory_uri(); |
|---|
| 299 |
break; |
|---|
| 300 |
case 'admin_email': |
|---|
| 301 |
$output = get_option('admin_email'); |
|---|
| 302 |
break; |
|---|
| 303 |
case 'charset': |
|---|
| 304 |
$output = get_option('blog_charset'); |
|---|
| 305 |
if ('' == $output) $output = 'UTF-8'; |
|---|
| 306 |
break; |
|---|
| 307 |
case 'html_type' : |
|---|
| 308 |
$output = get_option('html_type'); |
|---|
| 309 |
break; |
|---|
| 310 |
case 'version': |
|---|
| 311 |
global $wp_version; |
|---|
| 312 |
$output = $wp_version; |
|---|
| 313 |
break; |
|---|
| 314 |
case 'language': |
|---|
| 315 |
$output = get_locale(); |
|---|
| 316 |
$output = str_replace('_', '-', $output); |
|---|
| 317 |
break; |
|---|
| 318 |
case 'text_direction': |
|---|
| 319 |
global $wp_locale; |
|---|
| 320 |
$output = $wp_locale->text_direction; |
|---|
| 321 |
break; |
|---|
| 322 |
case 'name': |
|---|
| 323 |
default: |
|---|
| 324 |
$output = get_option('blogname'); |
|---|
| 325 |
break; |
|---|
| 326 |
} |
|---|
| 327 |
|
|---|
| 328 |
$url = true; |
|---|
| 329 |
if (strpos($show, 'url') === false && |
|---|
| 330 |
strpos($show, 'directory') === false && |
|---|
| 331 |
strpos($show, 'home') === false) |
|---|
| 332 |
$url = false; |
|---|
| 333 |
|
|---|
| 334 |
if ( 'display' == $filter ) { |
|---|
| 335 |
if ( $url ) |
|---|
| 336 |
$output = apply_filters('bloginfo_url', $output, $show); |
|---|
| 337 |
else |
|---|
| 338 |
$output = apply_filters('bloginfo', $output, $show); |
|---|
| 339 |
} |
|---|
| 340 |
|
|---|
| 341 |
return $output; |
|---|
| 342 |
} |
|---|
| 343 |
|
|---|
| 344 |
|
|---|
| 345 |
|
|---|
| 346 |
|
|---|
| 347 |
|
|---|
| 348 |
|
|---|
| 349 |
|
|---|
| 350 |
|
|---|
| 351 |
|
|---|
| 352 |
|
|---|
| 353 |
|
|---|
| 354 |
|
|---|
| 355 |
|
|---|
| 356 |
|
|---|
| 357 |
|
|---|
| 358 |
|
|---|
| 359 |
|
|---|
| 360 |
|
|---|
| 361 |
|
|---|
| 362 |
|
|---|
| 363 |
|
|---|
| 364 |
|
|---|
| 365 |
|
|---|
| 366 |
function wp_title($sep = '»', $display = true, $seplocation = '') { |
|---|
| 367 |
global $wpdb, $wp_locale, $wp_query; |
|---|
| 368 |
|
|---|
| 369 |
$cat = get_query_var('cat'); |
|---|
| 370 |
$tag = get_query_var('tag_id'); |
|---|
| 371 |
$category_name = get_query_var('category_name'); |
|---|
| 372 |
$author = get_query_var('author'); |
|---|
| 373 |
$author_name = get_query_var('author_name'); |
|---|
| 374 |
$m = get_query_var('m'); |
|---|
| 375 |
$year = get_query_var('year'); |
|---|
| 376 |
$monthnum = get_query_var('monthnum'); |
|---|
| 377 |
$day = get_query_var('day'); |
|---|
| 378 |
$title = ''; |
|---|
| 379 |
|
|---|
| 380 |
$t_sep = '%WP_TITILE_SEP%'; |
|---|
| 381 |
|
|---|
| 382 |
// If there's a category |
|---|
| 383 |
if ( !empty($cat) ) { |
|---|
| 384 |
|
|---|
| 385 |
if ( !stristr($cat,'-') ) |
|---|
| 386 |
$title = apply_filters('single_cat_title', get_the_category_by_ID($cat)); |
|---|
| 387 |
} elseif ( !empty($category_name) ) { |
|---|
| 388 |
if ( stristr($category_name,'/') ) { |
|---|
| 389 |
$category_name = explode('/',$category_name); |
|---|
| 390 |
if ( $category_name[count($category_name)-1] ) |
|---|
| 391 |
$category_name = $category_name[count($category_name)-1]; |
|---|
| 392 |
else |
|---|
| 393 |
$category_name = $category_name[count($category_name)-2]; |
|---|
| 394 |
} |
|---|
| 395 |
$cat = get_term_by('slug', $category_name, 'category', OBJECT, 'display'); |
|---|
| 396 |
if ( $cat ) |
|---|
| 397 |
$title = apply_filters('single_cat_title', $cat->name); |
|---|
| 398 |
} |
|---|
| 399 |
|
|---|
| 400 |
if ( !empty($tag) ) { |
|---|
| 401 |
$tag = get_term($tag, 'post_tag', OBJECT, 'display'); |
|---|
| 402 |
if ( is_wp_error( $tag ) ) |
|---|
| 403 |
return $tag; |
|---|
| 404 |
if ( ! empty($tag->name) ) |
|---|
| 405 |
$title = apply_filters('single_tag_title', $tag->name); |
|---|
| 406 |
} |
|---|
| 407 |
|
|---|
| 408 |
|
|---|
| 409 |
if ( !empty($author) ) { |
|---|
| 410 |
$title = get_userdata($author); |
|---|
| 411 |
$title = $title->display_name; |
|---|
| 412 |
} |
|---|
| 413 |
if ( !empty($author_name) ) { |
|---|
| 414 |
|
|---|
| 415 |
$title = $wpdb->get_var($wpdb->prepare("SELECT display_name FROM $wpdb->users WHERE user_nicename = %s", $author_name)); |
|---|
| 416 |
} |
|---|
| 417 |
|
|---|
| 418 |
|
|---|
| 419 |
if ( !empty($m) ) { |
|---|
| 420 |
$my_year = substr($m, 0, 4); |
|---|
| 421 |
$my_month = $wp_locale->get_month(substr($m, 4, 2)); |
|---|
| 422 |
$my_day = intval(substr($m, 6, 2)); |
|---|
| 423 |
$title = "$my_year" . ($my_month ? "$t_sep$my_month" : "") . ($my_day ? "$t_sep$my_day" : ""); |
|---|
| 424 |
} |
|---|
| 425 |
|
|---|
| 426 |
if ( !empty($year) ) { |
|---|
| 427 |
$title = $year; |
|---|
| 428 |
if ( !empty($monthnum) ) |
|---|
| 429 |
$title .= "$t_sep" . $wp_locale->get_month($monthnum); |
|---|
| 430 |
if ( !empty($day) ) |
|---|
| 431 |
$title .= "$t_sep" . zeroise($day, 2); |
|---|
| 432 |
} |
|---|
| 433 |
|
|---|
| 434 |
|
|---|
| 435 |
if ( is_single() || ( is_page() && !is_front_page() ) ) { |
|---|
| 436 |
$post = $wp_query->get_queried_object(); |
|---|
| 437 |
$title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) ); |
|---|
| 438 |
} |
|---|
| 439 |
|
|---|
| 440 |
|
|---|
| 441 |
if ( is_tax() ) { |
|---|
| 442 |
$taxonomy = get_query_var( 'taxonomy' ); |
|---|
| 443 |
$tax = get_taxonomy( $taxonomy ); |
|---|
| 444 |
$tax = $tax->label; |
|---|
| 445 |
$term = $wp_query->get_queried_object(); |
|---|
| 446 |
$term = $term->name; |
|---|
| 447 |
$title = "$tax$t_sep$term"; |
|---|
| 448 |
} |
|---|
| 449 |
|
|---|
| 450 |
if ( is_404() ) { |
|---|
| 451 |
$title = __('Page not found'); |
|---|
| 452 |
} |
|---|
| 453 |
|
|---|
| 454 |
$prefix = ''; |
|---|
| 455 |
if ( !empty($title) ) |
|---|
| 456 |
$prefix = " $sep "; |
|---|
| 457 |
|
|---|
| 458 |
|
|---|
| 459 |
if ( 'right' == $seplocation ) { |
|---|
| 460 |
$title_array = explode( $t_sep, $title ); |
|---|
| 461 |
$title_array = array_reverse( $title_array ); |
|---|
| 462 |
$title = implode( " $sep ", $title_array ) . $prefix; |
|---|
| 463 |
} else { |
|---|
| 464 |
$title_array = explode( $t_sep, $title ); |
|---|
| 465 |
$title = $prefix . implode( " $sep ", $title_array ); |
|---|
| 466 |
} |
|---|
| 467 |
|
|---|
| 468 |
$title = apply_filters('wp_title', $title, $sep, $seplocation); |
|---|
| 469 |
|
|---|
| 470 |
|
|---|
| 471 |
if ( $display ) |
|---|
| 472 |
echo $title; |
|---|
| 473 |
else |
|---|
| 474 |
return $title; |
|---|
| 475 |
|
|---|
| 476 |
} |
|---|
| 477 |
|
|---|
| 478 |
|
|---|
| 479 |
|
|---|
| 480 |
|
|---|
| 481 |
|
|---|
| 482 |
|
|---|
| 483 |
|
|---|
| 484 |
|
|---|
| 485 |
|
|---|
| 486 |
|
|---|
| 487 |
|
|---|
| 488 |
|
|---|
| 489 |
|
|---|
| 490 |
|
|---|
| 491 |
|
|---|
| 492 |
|
|---|
| 493 |
|
|---|
| 494 |
|
|---|
| 495 |
|
|---|
| 496 |
function single_post_title($prefix = '', $display = true) { |
|---|
| 497 |
global $wpdb; |
|---|
| 498 |
$p = get_query_var('p'); |
|---|
| 499 |
$name = get_query_var('name'); |
|---|
| 500 |
|
|---|
| 501 |
if ( intval($p) || '' != $name ) { |
|---|
| 502 |
if ( !$p ) |
|---|
| 503 |
$p = $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_name = %s", $name)); |
|---|
| 504 |
$post = & get_post($p); |
|---|
| 505 |
$title = $post->post_title; |
|---|
| 506 |
$title = apply_filters('single_post_title', $title); |
|---|
| 507 |
if ( $display ) |
|---|
| 508 |
echo $prefix.strip_tags($title); |
|---|
| 509 |
else |
|---|
| 510 |
return strip_tags($title); |
|---|
| 511 |
} |
|---|
| 512 |
} |
|---|
| 513 |
|
|---|
| 514 |
|
|---|
| 515 |
|
|---|
| 516 |
|
|---|
| 517 |
|
|---|
| 518 |
|
|---|
| 519 |
|
|---|
| 520 |
|
|---|
| 521 |
|
|---|
| 522 |
|
|---|
| 523 |
|
|---|
| 524 |
|
|---|
| 525 |
|
|---|
| 526 |
|
|---|
| 527 |
|
|---|
| 528 |
|
|---|
| 529 |
|
|---|
| 530 |
|
|---|
| 531 |
function single_cat_title($prefix = '', $display = true ) { |
|---|
| 532 |
$cat = intval( get_query_var('cat') ); |
|---|
| 533 |
if ( !empty($cat) && !(strtoupper($cat) == 'ALL') ) { |
|---|
| 534 |
$my_cat_name = apply_filters('single_cat_title', get_the_category_by_ID($cat)); |
|---|
| 535 |
if ( !empty($my_cat_name) ) { |
|---|
| 536 |
if ( $display ) |
|---|
| 537 |
echo $prefix.strip_tags($my_cat_name); |
|---|
| 538 |
else |
|---|
| 539 |
return strip_tags($my_cat_name); |
|---|
| 540 |
} |
|---|
| 541 |
} else if ( is_tag() ) { |
|---|
| 542 |
return single_tag_title($prefix, $display); |
|---|
| 543 |
} |
|---|
| 544 |
} |
|---|
| 545 |
|
|---|
| 546 |
|
|---|
| 547 |
|
|---|
| 548 |
|
|---|
| 549 |
|
|---|
| 550 |
|
|---|
| 551 |
|
|---|
| 552 |
|
|---|
| 553 |
|
|---|
| 554 |
|
|---|
| 555 |
|
|---|
| 556 |
|
|---|
| 557 |
|
|---|
| 558 |
|
|---|
| 559 |
|
|---|
| 560 |
|
|---|
| 561 |
|
|---|
| 562 |
|
|---|
| 563 |
function single_tag_title($prefix = '', $display = true ) { |
|---|
| 564 |
if ( !is_tag() ) |
|---|
| 565 |
return; |
|---|
| 566 |
|
|---|
| 567 |
$tag_id = intval( get_query_var('tag_id') ); |
|---|
| 568 |
|
|---|
| 569 |
if ( !empty($tag_id) ) { |
|---|
| 570 |
$my_tag = &get_term($tag_id, 'post_tag', OBJECT, 'display'); |
|---|
| 571 |
if ( is_wp_error( $my_tag ) ) |
|---|
| 572 |
return false; |
|---|
| 573 |
$my_tag_name = apply_filters('single_tag_title', $my_tag->name); |
|---|
| 574 |
if ( !empty($my_tag_name) ) { |
|---|
| 575 |
if ( $display ) |
|---|
| 576 |
echo $prefix . $my_tag_name; |
|---|
| 577 |
else |
|---|
| 578 |
return $my_tag_name; |
|---|
| 579 |
} |
|---|
| 580 |
} |
|---|
| 581 |
} |
|---|
| 582 |
|
|---|
| 583 |
|
|---|
| 584 |
|
|---|
| 585 |
|
|---|
| 586 |
|
|---|
| 587 |
|
|---|
| 588 |
|
|---|
| 589 |
|
|---|
| 590 |
|
|---|
| 591 |
|
|---|
| 592 |
|
|---|
| 593 |
|
|---|
| 594 |
|
|---|
| 595 |
|
|---|
| 596 |
|
|---|
| 597 |
|
|---|
| 598 |
|
|---|
| 599 |
|
|---|
| 600 |
|
|---|
| 601 |
function single_month_title($prefix = '', $display = true ) { |
|---|
| 602 |
global $wp_locale; |
|---|
| 603 |
|
|---|
| 604 |
$m = get_query_var('m'); |
|---|
| 605 |
$year = get_query_var('year'); |
|---|
| 606 |
< |
|---|