Try Tuts+ Premium, Get Cash Back!
Quick Tip: How to Target WordPress Sticky Posts
videos

Quick Tip: How to Target WordPress Sticky Posts

Tutorial Details
  • Topic: WordPress
  • Difficulty: Easy
  • Format: 3 Minute Screencast

As of WordPress 2.7, we can now assign “sticky posts.” This feature affords us the ability to “pin” postings to the top of our blog. But, how can we specifically target these sorts of postings from within our stylesheet?

Notice the pretty ribbon that’s attached to this particular posting? That’s thanks to stickied posts!

Adjust the resolution to 720 for maximum clarity.

Subscribe to our YouTube page to watch all of the video tutorials!

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • http://www.qubesys.com/ Magento Web Design

    This works the best for frontpage featured slideshow. I love this feature, since it has made it easy for the admins.

  • http://hayloftdesign.com Matt Barnes

    Nice tip. I’ve been using WordPress for a while now, and I didn’t know about sticky posts.

  • http://vijayjoshi.org/ Vijay Joshi

    Simple but extremely useful tip.
    Thanks.

  • Gavin

    Great tip, I wonder if the same method lets you target a category? So you could make all video posts have a specific colour?

  • http://www.twostepmedia.co.uk Ben Howdle

    Hello Mr. Way,

    This is a great tutorial and very useful, especially for someone who is new to blogging and writing tutorials in general and also I’ve only recently started using WordPress and realising how awesome it is. One thing however i cannot work out, is if my blog url is http://blog.twostepmedia.co.uk by default this page shows all of my posts in full. How do i change this so the page only show excerpts from each post and a Read More link?

    Anyway, thanks for the tip!

    • http://www.nouveller.com Benjamin Reid

      It depends what function you have in your loop. If you have “the_excerpt()”, make sure you actually set an excerpt for each post.

      Otherwise, take a read up on “the_content()” function to understand how to provide a cut off point for your “read more” links.

      http://codex.wordpress.org/Function_Reference/the_content

  • Jake

    Thanks for this! really needed it! :) you also have an awesome dog btw. lol

  • http://www.weareprimate.co.uk Gordon @ Primate

    Nice tip. Also, aside from the obvious aesthetic and usability benefits featuring a post can have, it’s also handy if you want to necromance order posts so they can suck up some link juice from your main page, great if you’ve written about something previously that’s now trending on the net.

  • http://www.drivvedwebbyra.se Erik

    Thx for the tip I was lucky to find this here!

  • http://www.lavalleecreative.com Stephen

    Nice tip. Negates the need to create a ‘Featured’ category or something. Thanks.

  • http://www.blogtycoon.net/ Chip

    Speaking of sliders and sticky posts, WordPress has a great plugin targeting sticky posts – http://wordpress.org/extend/plugins/sticky-slider/.

    Too many plugins for featured content and not one based on WordPress sticky feature. It’s there to be used, not overlooked.

    Great article about a forgotten feature.

  • http://www.slovensky-raj.net/ Stefan

    There are so many things which makes life easier :) I just need to explore them! Thank you.

  • http://www.intenseblog.com Jennier R

    I’ve known about sticky posts for a long time but have not used it anytime, however, thank you for your nice tut :)

  • El garch

    i liked the tip ;) thanks a lot

  • http://www.fmys.com Shekhar Mehta

    wow so simple but really very useful tutorial..I m regular user of wordpress but was not knowing about this sticky thing..thanks mr. way..

  • http://www.yourdigitalspace.com Swamykant

    I was looking for the tip. excellent post. I will surely try this. Thanks

  • http://whatafy.com/ Whatafy

    I can’t get it work for categories, any help would be appreciated.

  • http://tutspress.com tutspress

    very easily! thanks for the tip.

  • Ediablo

    IT Is Perfect , I Hope That could be easy for me :D