Last active
December 16, 2015 22:17
-
-
Save mrwweb/8a1ca2617ef3e1aa1e50 to your computer and use it in GitHub Desktop.
Add sticky class to posts in archives
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function {prefix}_post_class( $classes ) { | |
if( is_archive() && is_sticky() ) { | |
$classes[] = 'sticky'; | |
} | |
return $classes; | |
} | |
add_filter( 'post_class', '{prefix}_post_class' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment