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

April 14, 2008

I want to share with you one of the features that I included in the WordPress theme that I released yesterday, or at least my thinking behind it, because it is something that I thought about for a while before implementing. The features is tracking the user on certain pages to determine the type of links to offer.

When you include a previous, or next, post link in a template file you have the option of limiting the link to posts in the same category, and of limiting those categories to ensure that some are excluded from that.

The problem I have found with my themes is that hard coding this into the theme meant I was either limiting posts to categories when I didn’t want to, or I wasn’t limiting posts when I thought the user would probably expect it.

So, the user might select a category list and get an archive page. From that page they select a single post to view. If the user then chooses a newer or older post do they expect it to be restricted, or not? I thought so.

My solution was to offer a choice, but only under certain circumstances.

When a user visits a category page, the ID of that category is saved into a session variable. If they next visit a single page that is in that category, the category is retained; otherwise it is discarded.

If a user is viewing a single page and their session variable contains a category ID they are presented with a choice. Select a older or newer post from that category, or select an older or newer post from the blog as a whole.

If they do not have the session variable then they do not get the choice, they are automatically taken to the newer, or older, post from the blog as a whole.

I think this is a good way of meeting the users needs unobtrusively.

Theming Habari Vs Wordpress
Habari vs wordpress?
13 comments
page 440
Post Image The Easy Peasy Way
Get post attacments?
26 comments
page 1065
Are Child Themes The Best Option
Wp child themes?
15 comments
page 1262
Upload From Url
Upload to url?
6 comments
page 326
Silence Is Golden
Silence is golden wordpress?
3 comments
page 213
How To Add Sidebars To A Theme
Html hot add a side bar?
11 comments
page 1053
How To Add Sidebars To A Theme
How to add picture to the wordpress sidebar on sidebarphp?
11 comments
page 1053
Fun With Sidebar Tabs Styling
Position of the tabs thematic?
2 comments
page 336
Using Your Own Url Shortener
Short url?
4 comments
page 1190
Why I Ditched Disqus
Styling disqus widgets?
5 comments
page 1175
Wordpress 25 Exif Fields
Wordpress exif?
12 comments
page 230
Html 5 Gallery
Html 5 gallery?
6 comments
page 1305
Dont Mess With My Toot Toot
Fun with toots?
16 comments
page 599
Dont Mess With My Toot Toot
Fun with toots?
16 comments
page 599
Converting Wordpress Themes To Habari
Habari timthumb?
one comment
page 694
Wordpress 25 Exif Fields
Habari timthumb?
12 comments
page 230
Fun With Sidebar Tabs Styling
Tabs with html css on same page javascript?
2 comments
page 336
Using Your Own Url Shortener
How to have own url short?
4 comments
page 1190
Post Image The Easy Peasy Way
Insert conditional image php wp?
26 comments
page 1065
Using Your Own Url Shortener
Run short url using htaccess?
4 comments
page 1190
Dont Mess With My Toot Toot
New posttype not displayed wordpress?
16 comments
page 599
Quick N Dirty Replacement Text
Wpupdatepost object?
no comment
page 122
How To Add Sidebars To A Theme
Wordpress sidebar above main sidebars?
11 comments
page 1053
Html 5 Gallery
Html5 simple wordpress theme?
6 comments
page 1305
Updating Code Snippets Here
Fun wordpress plugin?
one comment
page 1338
How To Add Sidebars To A Theme
Wp register sidebars?
11 comments
page 1053
Html 5 Gallery
Html5 wordpress theme?
6 comments
page 1305
Post Image The Easy Peasy Way
Get post images?
26 comments
page 1065
Updating Code Snippets Here
Wordpress fun plugins?
one comment
page 1338
Post Image The Easy Peasy Way
Wordpress get first image large?
26 comments
page 1065
Using Wordpress As A Php Framework
Wordpress create your own framework?
2 comments
page 335
Improve Your Typography With Plugins
Wordpress typography plugin?
one comment
page 721
Quick N Dirty Replacement Text
Dirty replacement?
no comment
page 122
  1 query every 1923 seconds, updated 1 seconds ago.
Post a comment?