I have this code to display only the latest sticky post on the front page.
the strange thing is that, when I'm logged-in it shows non-sticky latest post, even if it's private...
<?php get_header(); ?>
<?php if ( is_home() && !is_paged() ) : ?>
<?php
// Get IDs of sticky posts
$sticky = get_option( 'sticky_posts' );
// first loop to display only my single,
// MOST RECENT sticky post
$most_recent_sticky_post = new WP_Query( array(
// Only sticky posts
'post__in' => $sticky,
// Treat them as sticky posts
'ignore_sticky_posts' => 1,
// Order by date to get the most recently published sticky post
'orderby' => date,
// Get only the one most recent
'posts_per_page' => 1
) );
?>
<?php while ( $most_recent_sticky_post->have_posts() ) : $most_recent_sticky_post->the_post(); ?>
<!-- your code to display most recent sticky -->
<?php endwhile; wp_reset_query(); ?>
<?php endif; ?>
The idea is that those logged-in see the exact same thing as those not logged-in.
Does anyone know how to present that?