Changeset 10877
- Timestamp:
- 04/06/2009 03:42:12 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post-template.php
r10810 r10877 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; … … 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() ) { … … 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"); … … 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
Note: See TracChangeset
for help on using the changeset viewer.