I’ve been trying to figure this out all day now.
Consider the following code below:
<div class="slider">
<div class="slides"><?php
wp_reset_query();
if(have_posts()) :
while (have_posts()) :
the_post();
if(is_sticky()) : ?>
<div class="slide"><a rel="bookmark" href="https://wordpress.stackexchange.com/questions/92193/<?php the_permalink() ?>"><?php echo the_post_thumbnail('full'); ?><h2><?php the_title(); ?></h2></a></div>
<?php endif;
endwhile;
else: ?>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>
<div class="left-arrow"></div>
<div class="right-arrow"></div>
</div>
</div>
The loop above doesn’t work on the site’s pages (e.g: page 2/3/4) or 404.php, but works perfectly fine on page 1 (the index.php).
Why is that and how do I fix this?