Let's say I've got some posts and some of them are sticky. The sticky posts are displayed at the very top in The Loop.

while( have_posts() ) {

How can I add some text after all sticky posts?

1 Answer 1


OK I got it.

First of all, add a counter before The Loop.

$my_posts = 0;

Then in The Loop increment it by one each time.


Stickies are always at the very top, so compare the number of all sticky posts with current post in The Loop and display custom message.

if( $my_posts === count( get_option( 'sticky_posts' ) ) )
  echo 'this will only appear after all sticky posts';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.