Skip to main content

Sticky Post – Always Displayed On Top

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent aliquet sapien ac velit volutpat sagittis. Vestibulum eu nunc eget risus laoreet mollis nec sit amet libero. Cras tempor lorem sit amet tempus laoreet. Fusce vitae est elit. Maecenas ac augue hendrerit, lacinia eros nec, elementum purus.

Donec sed sem at enim bibendum molestie eu ut nisl. Suspendisse dignissim eu leo a malesuada. Curabitur porta orci quam, hendrerit rutrum turpis malesuada sit amet. Praesent facilisis eu arcu a placerat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam convallis neque in odio hendrerit, eu accumsan arcu blandit.

This is a sticky post

There are a few things to verify:

  • The sticky post should be distinctly¬†recognizable¬†in some way in comparison to normal posts. You can style the .sticky class if you are using the post_class() function to generate your post classes, which is a best practice.
  • They should show at the very top of the blog index page, even though they could be several posts back chronologically.
  • They should still show up again in their chronologically correct postion in time, but without the sticky indicator.
  • If you have a plugin or widget that lists popular posts or comments, make sure that this sticky post is not always at the top of those lists unless it really is popular.

Aigars

Frontend web developer and web designer specialized in free and premium WordPress theme development. Started to learn to code 2 years ago and now I am familiar with CSS/HTML/JavaScript (jQuery) and PHP. Obsessed with application performance, user experience and simplicity.