Ferodynamics Network

popular: profile privacy, mobile privacy

November 19, 2008

On last weeks WordPress Weekly we had an interesting discussion about sticky posts and the new feature in 2.7. My contention is that sticky posts, while useful, are just plain wrong because they change a post into something it was never meant to be, and there is already a function to do that.

My argument is that a post, by definition, is something that is meant to be transient. It is based on time and so is always intended to fade away as new content replaces it. By making a post ’sticky’ you are changing it into something else, something that is not a post.

Pages on the other hand are exactly what sticky posts are aiming to achieve. They are static pieces of content without time constraints. They are logically, procedurally and philosophically the very thing that sticky posts aims to provide.

The argument that was put to me was that while this may be true the practicalities outweigh the philosophical differences. That ticking a box and making a post sticky requires no modifications to the theme and so is the best method for the most people, but I think that once you start bending aspects of WordPress within the core simply because this method is the one that has become popular, you are saying that these definitions don’t matter.

OK, so what do you need to do to uses page this way instead? Well it is simple really.

Create a new page in WordPress and give it a slug of sticky. Next add the following to your functions.php file:

[php]
function sticky_page(){
if ( is_home() ){
$page = get_page_by_path( '/sticky/' );
echo $page->post_content;
}
}

Finally, insert this into your index.php file where you want the content:

[php]

That doesn’t seem so difficult, right?

I would like to get your opinion on this. Am I being a bit of a philosophy Nazi by taking the view that sticky posts are table-based layouts for 2008? or should there be a clear distinction between blog post, and non-blog post content?

My Experience Of Flexx
4 comments
page 1026
Why You Should Try Netbeans
6 comments
page 973
Wpunlimited The Ultimate Wordpress Theme
3 comments
page 1141
Auto Cycle Fun With Sidebar Tabs
one comment
page 1129
Beware Wp Cache
8 comments
page 1310
Post Image The Easy Peasy Way
26 comments
page 1065
Wordpress 25 Exif Fields
12 comments
page 230
Html 5 Gallery
6 comments
page 1305
Quick N Dirty Comment Stats
no comment
page 130
Beware Wp Cache
8 comments
page 1310
Divine Proportions
3 comments
page 145
Html 5 Gallery
6 comments
page 1305
Beware Wp Cache
8 comments
page 1310
Charcoal Theme Available For Wordpress
2 comments
page 959
Html 5 Gallery
6 comments
page 1305
Post Image The Easy Peasy Way
26 comments
page 1065
Post Image The Easy Peasy Way
26 comments
page 1065
Quick N Dirty Admin Login Screen
no comment
page 128
Wordpress Chat
one comment
page 1308
Html 5 Gallery
6 comments
page 1305
Html 5 Gallery
6 comments
page 1305
Silence Is Golden
3 comments
page 213
Questions About Habari For Wordpress Users
6 comments
page 424
Theming Habari Vs Wordpress
13 comments
page 440
My Experience Of Flexx
4 comments
page 1026
Plugin Update Fun With Photo Data 2
one comment
page 815
Post Image The Easy Peasy Way
26 comments
page 1065
Categories Vs Tags Either Neither Or Both
12 comments
page 7
Gaining Benefits From Plugins
8 comments
page 1167
Fun With Theme Widgets
24 comments
page 867
Beware Wp Cache
8 comments
page 1310
Six Million Ways To Die Choose One
14 comments
page 1128
Post Image The Easy Peasy Way
26 comments
page 1065
Post Image The Easy Peasy Way
26 comments
page 1065
Wordpress Chat
one comment
page 1308
Post Image The Easy Peasy Way
26 comments
page 1065
  updated 1 seconds ago
Saturday, 9pm
Monika

Hi
I think it is the same diskussion as *categories and tags* – for me both are drawer,maybe a category is a larger drawer than a tag-maybe ;)

Your solution is beautiful for all they would like to use only static pages, but for *everyday* user it is a philosophical problem and I love philosophie but I'm a pragmatist. To make a *click* is better than to write a hack ;)

and – most of the time – I thought:sticky posts are only modern:why do we need sticky posts at all ;)

but with your solution I can do many other things – great-thanks a lot for the idea ;)

Friday, 3pm
Tobias

Andrew,

“but if you want to start seriously organising information the definitions between different content types really matter”

I agree, but particularly in that case I think posts and pages are two custom ways to organize content units. I'm thinking it would be much more logical to start with a “page” tree (display structure) like in typo3 and then decide which content units to assign to which display unit (“blog/page”). I mean, in a way, that's what WP does already with the feature to have a non-blog homepage. Why have two essentially identical management pages for these two post types? Why not have one with a filter for post type to edit the contents quickly and one to determine the page structure? I think that the real problem is the special treatment of the pages content type…

Thursday, 11pm
Andrew Rickmann

That's what I argued about categories and tags and everyone seemed to disagree and claimed they were very different things entirely.

Thursday, 11pm
Andrew Rickmann

The thing is, if you just use WordPress casually perhaps it doesn't matter one jot what the difference between a post and a page is, but if you want to start seriously organising information the definitions between different content types really matter, and bending them in a core feature really starts to muddy the waters.

The point I was making about tagging something 'featured' was that I would do that if all I wanted to do was give something more prominence through styling, not if I wanted it to stay outside the chronology.

Thursday, 9pm
Tobias

I think there is no clear cut correct approach for this kind of thing. The problem starts with the definition of post and page in WP. In the end a post and a page are just two content containers. One is displayed in a hierarchical fashion and the other is displayed in chronological, categorical, tagged or individual views. Personally, I think this dichotomy will have to be abandoned as WP is moving towards a more comprehensive CMS solution.

In the end, how is a post attribute of “sticky” different from a tag “sticky” with a custom query ahead of the standard query?

Thursday, 8pm
Sean O

What's the difference? A post is a page and page is a post. The only real difference is that a page doesn't move down the screen with the passage of time and a page can be stuck more easily into the sidebar and can be hierarchical. Wouldn't just be easier to have only one document and then declare how that document works (sidebar, time stamped to move, etc.)?

Wednesday, 11pm
Andrew Rickmann

When I say static I don't mean it in the sense of plain HTML versus PHP I mean it in the sense of non-chronological. In WordPress, pages are identical to posts in that they are the same type of object so there is nothing you can do with one that you can't do with the other, except that posts are dated.

The fact that you might want to pull information from another part of WordPress, i.e. the comments for a particular post doesn't change the non-chronological nature of the presentation.

I will take your word on TC. I don't subscribe to it so I had only the timing of the first comment to compare.

Wednesday, 10pm
wesley

Is it static? A featured post that you move outside of the normal loop will still have to display the nr of comments it has, etc.. which is dynamic.

And the current post on tc is definitely a little older than the post below, you can see this if you compare the order with your RSS reader.

You also see at TC that the featured post is wider than the posts below, for instance.

Wednesday, 8pm
Andrew Rickmann

Hmm Techcrunch is showing me all the posts in order, excerpts of them at least. Perhaps the current post is the exception.

If all you want to do is make it more prominent then that is not a sticky post as such, you are just using the sticky mechanism to style it differently. Personally I would just tag it 'featured' so that a list of featured posts was automatically generated via the tagging mechanism but either way it is still in the chronology and still a post.

If, on the other hand, you decide to remove it from the chronology by sticking it to the top of the post list you are making the decision to display content statically (that is non-chronologically). The fact that it duplicates the excerpt of a post doesn't change the philosophical point that they are two different types of data.

Wednesday, 8pm
wesley

You are wrong in that sticky posts could only be used for static content.

What if I want to “feature” a post and give it more attention? (Diff bg color, etc) this could be achieved with a sticky post.

In fact, this is wha techcrunch.com also does. The first post is a featured post and is not necessarily the newest.