Ticket #9457: 9457.diff
| File 9457.diff, 1.6 KB (added by , 17 years ago) |
|---|
-
Users/denis/Sites/sem-pro/wp-includes/post-template.php
384 384 $classes[] = 'error404'; 385 385 386 386 if ( is_single() ) { 387 the_post(); 387 $wp_query->post = $wp_query->posts[0]; 388 setup_postdata($wp_query->post); 388 389 389 390 $postID = $wp_query->post->ID; 390 391 $classes[] = 'single postid-' . $postID; … … 394 395 $mime_prefix = array( 'application/', 'image/', 'text/', 'audio/', 'video/', 'music/' ); 395 396 $classes[] = 'attachmentid-' . $postID . ' attachment-' . str_replace( $mime_prefix, "", "$mime_type" ); 396 397 } 397 398 rewind_posts();399 398 } elseif ( is_archive() ) { 400 399 if ( is_author() ) { 401 400 $author = $wp_query->get_queried_object(); … … 411 410 $classes[] = 'tag-' . $tags->slug; 412 411 } 413 412 } elseif ( is_page() ) { 414 the_post(); 415 413 $wp_query->post = $wp_query->posts[0]; 414 setup_postdata($wp_query->post); 415 416 416 $pageID = $wp_query->post->ID; 417 417 $page_children = wp_list_pages("child_of=$pageID&echo=0"); 418 418 … … 424 424 425 425 if ( is_page_template() ) 426 426 $classes[] = 'page-template page-template-' . str_replace( '.php', '-php', get_post_meta( $pageID, '_wp_page_template', true ) ); 427 428 rewind_posts();429 427 } elseif ( is_search() ) { 430 the_post(); 431 432 if ( have_posts() ) 428 if ( !empty($wp_query->posts) ) 433 429 $classes[] = 'search-results'; 434 430 else 435 431 $classes[] = 'search-no-results'; 436 437 rewind_posts();438 432 } 439 433 440 434 if ( is_user_logged_in() )