[wp-trac] [WordPress Trac] #23559: Sticky single post page doesn't have .sticky class

WordPress Trac noreply at wordpress.org
Wed Feb 20 12:33:08 UTC 2013


#23559: Sticky single post page doesn't have .sticky class
-------------------------+------------------------------
 Reporter:  sgr33n       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Template     |     Version:  2.7
 Severity:  normal       |  Resolution:
 Keywords:  2nd-opinion  |
-------------------------+------------------------------
Changes (by SergeyBiryukov):

 * keywords:   => 2nd-opinion


Comment:

 A workaround:
 {{{
 function sticky_class_for_single_post_23559( $classes, $class, $post_id )
 {
         if ( ! in_array( 'sticky', $classes ) && is_sticky( $post_id ) &&
 ! is_paged() )
                 $classes[] = 'sticky';

         return $classes;
 }
 add_filter( 'post_class', 'sticky_class_for_single_post_23559', 10, 3 );
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23559#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list