Ticket #11439: 11439.patch
| File 11439.patch, 1.8 KB (added by , 17 years ago) |
|---|
-
wp-includes/post-template.php
363 363 * @return array Array of classes. 364 364 */ 365 365 function get_body_class( $class = '' ) { 366 global $wp_query, $ wpdb, $current_user;366 global $wp_query, $current_user; 367 367 368 368 $classes = array(); 369 369 … … 388 388 $classes[] = 'error404'; 389 389 390 390 if ( is_single() ) { 391 $wp_query->post = $wp_query->posts[0]; 392 setup_postdata($wp_query->post); 393 394 $postID = $wp_query->post->ID; 391 $postID = $wp_query->get_queried_object_id(); 392 395 393 $classes[] = 'single postid-' . $postID; 396 394 397 395 if ( is_attachment() ) { 398 $mime_type = get_post_mime_type( );396 $mime_type = get_post_mime_type($postID); 399 397 $mime_prefix = array( 'application/', 'image/', 'text/', 'audio/', 'video/', 'music/' ); 400 398 $classes[] = 'attachmentid-' . $postID; 401 399 $classes[] = 'attachment-' . str_replace($mime_prefix, '', $mime_type); … … 417 415 } elseif ( is_page() ) { 418 416 $classes[] = 'page'; 419 417 420 $wp_query->post = $wp_query->posts[0]; 421 setup_postdata($wp_query->post); 418 $pageID = $wp_query->get_queried_object_id(); 422 419 423 $p ageID = $wp_query->post->ID;420 $post = get_page($pageID); 424 421 425 422 $classes[] = 'page-id-' . $pageID; 426 423 427 424 if ( $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' LIMIT 1", $pageID) ) ) 428 425 $classes[] = 'page-parent'; 429 426 430 if ( $ wp_query->post->post_parent ) {427 if ( $post->post_parent ) { 431 428 $classes[] = 'page-child'; 432 $classes[] = 'parent-pageid-' . $ wp_query->post->post_parent;429 $classes[] = 'parent-pageid-' . $post->post_parent; 433 430 } 434 431 if ( is_page_template() ) { 435 432 $classes[] = 'page-template';
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)