I would like to “highlight” a featured post above all other posts with a special indicator.
Is there a feature in WordPress that will do this or do I need to install a third party plug-in?
I am using a custom WordPress install (not WP hosted).
I would like to “highlight” a featured post above all other posts with a special indicator.
Is there a feature in WordPress that will do this or do I need to install a third party plug-in?
I am using a custom WordPress install (not WP hosted).
You must be logged in to post a comment.
Use the “sticky” feature.
In the “Page Attributes” metabox (labelled as Publish), if you click the “edit” link next to the Visibility option, there is a checkbox which allows you to “Stick this post to the front page”.
Unless a theme overrides the default query, that post will show up above all the others. In addition, it adds the class name “sticky” to the attributes returned by
post_class()
, so you can style it however you want.To add some text to your featured posts and highlight them, add a function like this inside the loop in your index.php (or loop.php, etc., depending on your theme):
You can do the same thing with the css :before property, like this:
(assuming you’re using h2’s to display the titles of your posts, and you want to add the text before the title)