Make WordPress Core

Ticket #18035: 18035_3.diff

File 18035_3.diff, 596 bytes (added by ankit.gade@…, 12 years ago)

Check if query is for secondary loop. then add sticky class.

  • wp-includes/post-template.php

     
    436436
    437437        // sticky for Sticky Posts
    438438        if ( is_sticky( $post->ID ) ) {
    439                 if ( is_home() && ! is_paged() && ! get_query_var( 'ignore_sticky_posts' ) ) {
     439                if ( is_home() && ! is_paged() && ( ( ! get_query_var( 'ignore_sticky_posts' ) && is_main_query() ) || ( ! is_main_query() ) ) ) {
    440440                        $classes[] = 'sticky';
    441441                } elseif ( is_admin() ) {
    442442                        $classes[] = 'status-sticky';