sticky_class

Display "sticky" CSS class, if a post is sticky.

Description

sticky_class( (null) $post_id = null ); 

Parameters (1)

0. $post_id — Optional. (null) => null
An optional post ID.

Usage

  1. if ( !function_exists( 'sticky_class' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // An optional post ID. 
  5. $post_id = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = sticky_class($post_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/deprecated.php  
  1. function sticky_class( $post_id = null ) { 
  2. _deprecated_function( __FUNCTION__, '3.5.0', 'post_class()' ); 
  3. if ( is_sticky( $post_id ) ) 
  4. echo ' sticky';