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.



Wordpress title showing space?
no comment on page 1371

Wordpress fun?
one comment on page 1376

Live blogging plugin?
4 comments on page 1258

Wordpress 3 admin speed up?
4 comments on page 1321

Framework photoshop?
3 comments on page 296

Fun wp plugins?
one comment on page 1376

Habari vs wordpress?
12 comments on page 440

Wp tags vs categories?
12 comments on page 7

Wordpress rss seo?
one comment on page 1361

Photo albums html5?
6 comments on page 1305

Wordpress chat?
no comment on page 1308

Wordpress exif data?
12 comments on page 230

Css sidear tab?
2 comments on page 336

Wordpress theme html5 blueprint?
6 comments on page 1305

Wordpress shortcode in plugin?
no comment on page 236

Html 50 photo album?
6 comments on page 1305

Get the post attachement?
24 comments on page 1065

Wordpress plugin development 30?
one comment on page 1373

Wordpress plugin development 30?
one comment on page 1373

Disqus formatting?
7 comments on page 1175

Html5 photoalbum?
6 comments on page 1305

Html5 photoalbum?
6 comments on page 1305

Wordpress fun?
one comment on page 1376

Fun wordpress plugins?
one comment on page 1376

Url shortener ideas?
4 comments on page 1190

Url shortener ideas?
4 comments on page 1190

Html 5 photo gallery?
6 comments on page 1305

Multiple post navigation?
no comment on page 1147

Html5 photo galleries?
6 comments on page 1305

Adding images to a wordpress 3 post?
24 comments on page 1065

Html5 photo gallery code?
6 comments on page 1305

Wordpress multiple blog master?
one comment on page 1376

Wordpress 3 tableprefix?
one comment on page 1376

Wordpress 3 tableprefix?
2 comments on page 1374

Using wordpress as a framework?
2 comments on page 335

Single post image size?
24 comments on page 1065

Get featured image src wordpress?
24 comments on page 1065

Disqus wordpress mu?
7 comments on page 1175

Image gallery html 5?
6 comments on page 1305

Wordpress theimage?
24 comments on page 1065

Wpgetattachmentimagesrc size?
24 comments on page 1065
  every 1739s, 1s ago, in 0.03s.
Post a comment?

0s