I’m using sticky posts to allow certain posts to be pinned in a featured post area. I have it working on a development server but when I moved it to the live server it only partially works. If there is a sticky post it displays it. But if there isn’t a sticky post it displays nothing and it should display the most recent post. Is there an alternate way to handle this that may work?
$options = array(
'post_type' => post,
'posts_per_page' => 1,
'post__in' => get_option( 'sticky_posts' ),
'ignore_sticky_posts' => 1,
'status' => 'publish'
);
You can check result of
get_option( 'sticky_posts' )
first: