function bitt_get_sticky_posts()
Fetches the list of sticky posts from WordPress and returns them in a comma-separated value.
Useful for queries when you only want to get the sticky posts. You can then use the return value of this function for the post__in
parameter.
if(!function_exists(‘bitt_get_sticky_posts’)) {
function bitt_get_sticky_posts() {
$sticky = get_option( ‘sticky_posts’ );
if($sticky) {
$sticky_posts= implode(‘,’, $sticky);
return $sticky_posts;
}
}
}