I need to display the “sticky” post in a section that is outside the “loop”.
Can someone tell me how to do this?
I need to display the “sticky” post in a section that is outside the “loop”.
Can someone tell me how to do this?
You must be logged in to post a comment.
I am using this query;
Hope it works for you too.. 🙂
(this gets a single post)
use get_posts() with the
'include' => implode(',', get_option('sticky_posts'))
argument to get all sticky posts (Martin’s solution without array_slice will do the same).