Warning: This function has been deprecated. Use post_class() instead.

sticky_class() WordPress Function

Sticky_class() is a Wordpress function that allows you to add a "sticky" class to any element on your website. This can be useful for making sure that certain elements are always visible, or for creating special effects.

sticky_class( int $post_id = null ) #

Display “sticky” CSS class, if a post is sticky.


Description

Top ↑

See also


Top ↑

Parameters

$post_id

(int)(Optional)An optional post ID.

Default value: null


Top ↑

Source

File: wp-includes/deprecated.php

function sticky_class( $post_id = null ) {
	_deprecated_function( __FUNCTION__, '3.5.0', 'post_class()' );
	if ( is_sticky( $post_id ) )
		echo ' sticky';
}


Top ↑

Changelog

Changelog
VersionDescription
3.5.0Use post_class()
2.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More