888888.888888.88""Yb..dP"Yb..8888b..Yb..dP.88b.88....db....8b....d8.88..dP""b8..dP"Y8
88__...88__...88__dP.dP...Yb..8I..Yb.YbdP..88Yb88...dPYb...88b..d88.88.dP...`".`Ybo."
88""...88""...88"Yb..Yb...dP..8I..dY..8P...88.Y88..dP__Yb..88YbdP88.88.Yb......o.`Y8b
88.....888888.88..Yb..YbodP..8888Y"..dP....88..Y8.dP""""Yb.88.YY.88.88..YboodP.8bodP'


88b.88.888888.888888.Yb........dP.dP"Yb..88""Yb.88..dP
88Yb88.88__.....88....Yb..db..dP.dP...Yb.88__dP.88odP.
88.Y88.88"".....88.....YbdPYbdP..Yb...dP.88"Yb..88"Yb.
88..Y8.888888...88......YP..YP....YbodP..88..Yb.88..Yb

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?

Quick N Dirty Admin Login Screen
Css login page?
no comment
page 128
What Wordpress Workflow Needs
Draft changes page wordpress?
3 comments
page 1226
Post Image The Easy Peasy Way
Wordpress add image size grayed?
26 comments
page 1065
Html 5 Gallery
Wordpress html5 photo gallery?
6 comments
page 1305
Quick N Dirty Admin Login Screen
Login page css?
no comment
page 128
Post Image The Easy Peasy Way
Get post image by id?
26 comments
page 1065
Why I Ditched Disqus
Formatting disqus code?
5 comments
page 1175
Six Million Ways To Die Choose One
6 esy ways to die?
14 comments
page 1128
Html 5 Gallery
Html 5 image gallery?
6 comments
page 1305
Wpunlimited The Ultimate Wordpress Theme
Ultimate wordpress theme?
3 comments
page 1141
What Wordpress Workflow Needs
Wordpress workflow?
3 comments
page 1226
Using Objects With Wordpress Plugins P 3
Wordpress class extends adminmenu?
5 comments
page 116
New Tabbed Widget Plugin
Comments widgets plugin?
no comment
page 333
Post Image The Easy Peasy Way
Wordpress function post image?
26 comments
page 1065
Html 5 Gallery
Wordpress themes html 50?
6 comments
page 1305
Wordpress Shortcodes What Why How
Wordpress shortcode?
no comment
page 236
Post Image The Easy Peasy Way
Wp get post image?
26 comments
page 1065
Dont Mess With My Toot Toot
Custom content types wordpress?
15 comments
page 599
Fun Without Cliches
Fun cliches?
12 comments
page 861
Wordpress Chat
Wp chat themes?
3 comments
page 1308
Post Image The Easy Peasy Way
Wp custom field arrau thumbnails?
26 comments
page 1065
Updating Code Snippets Here
Fun with plugins?
no comment
page 1338
Easy Peasy Images Suggestion Roundup
Display attached images within loop?
21 comments
page 1073
Post Image The Easy Peasy Way
Wp change post image size?
26 comments
page 1065
3 Ways To Speed Up Your Blog Without A Cache Plugin
Speed up disqus?
one comment
page 1321
Six Million Ways To Die Choose One
Simply ways to die?
14 comments
page 1128
Using Your Own Url Shortener
Use your domain as a url shortner?
4 comments
page 1190
Dont Mess With My Toot Toot
Dont mess with my toot toot?
15 comments
page 599
Post Image The Easy Peasy Way
Post image gallery wp?
26 comments
page 1065
Why I Ditched Disqus
Better than disqus?
5 comments
page 1175
Updating Code Snippets Here
Andy dp?
no comment
page 1338
Html 5 Gallery
Wordpress and html5?
6 comments
page 1305
Post Image The Easy Peasy Way
Wp get attachment?
26 comments
page 1065
  1 query every 1159 seconds, 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.