Happy February! And welcome to the first installment of (Anti) Social Lists in February 2009. I feel like I’ve been checking out a lot of sites recently but I don’t seem to have that much to offer. I found more sites to offer as the week drew to it’s close. I have had a terrible cold so it’s possible that my recollection of what I’ve been doing differs from reality. Anyway, enjoy!
How to Style a Sticky Post in WordPress 2.7
On Monday I finally found the sticky setting and on Wednesday I showed you how to add the post class to your template so that your sticky post would actually show up on the page.
Today I am going to show you how to style the sticky post. You might want it to look different from the rest of the posts, stand out in some way or not include the date.
Since we have already added the post class to our template, styling the sticky post only requires a little bit of CSS in the style sheet template.
WordPress 2.7 Post_Class Template Tag and Sticky Posts
On Monday I showed you where the sticky post setting was. Maybe you already knew but I had quite a time locating it and thought I might not be the only one having this problem.
So, you used that setting to make a post sticky and now you’re wondering why it isn’t working properly. Well, you have to add some code to your Main Index template.
WordPress 2.7 includes a new function called Post Class, which makes it easier to style certain parts of the theme. One of the classes used with post class is sticky. So, the template doesn’t know that a sticky post even exists until this new code is added.
How to Make a Post Sticky in WordPress 2.7
A sticky post in WordPress is one that stays at the top of the page no matter what gets posted after that. This is useful for a post that you want to highlight or for an announcement.
Way back the best way to make a post sticky was to fudge with the date – I would make it a date way in the future so it would stay the top post.
Then the WP-Sticky plugin was created, which allowed me to make a post sticky and gave me some control over styling. For example, if the sticky post is an announcement, I don’t want the date to be included because then it looks like a regular post.
(Anti) Social-Lists 1/25/09
I think I’ve got some good links for you this week as well as a couple of fun ones. Topics include freelancing, WordPress, Twitter, Feedburner, Inauguration Photos, Cats, and Calendars. Enjoy!
- « Previous Page
- 1
- …
- 111
- 112
- 113
- 114
- 115
- …
- 147
- Next Page »