sticky_class()
Deprecated since 3.5.0. It is no longer supported and may be removed in future releases. Use post_class() instead.
Outputs the CSS class "sticky" for the post if it is marked as a sticky post.
This tag should be used inside the WordPress Loop.
No Hooks.
Returns
null.
Usage
<?php sticky_class(); ?>
Examples
#1 Demo
<div class="post <?php sticky_class() ?>" id="post-<?php the_ID() ?>">
We get:
<div class="post sticky" id="post-123">
Notes
- See: post_class()
Changelog
| Since 2.7.0 | Introduced. |
| Deprecated since 3.5.0 | Use post_class() |
sticky_class() sticky class code WP 7.0
function sticky_class( $post_id = null ) {
_deprecated_function( __FUNCTION__, '3.5.0', 'post_class()' );
if ( is_sticky( $post_id ) )
echo ' sticky';
}