As mentioned in comments on my original mild objection, I’ve been convinced that threaded discussions, new in the upcoming WordPress version 2.7, are a good value at the price. So today I slapped support for the feature into Simplish. This version of the theme should be considered “beta” quality, just like the new WordPress features on which it’s built. Both are subject to change before final release.
The demo shows a “jacob’s ladder” style for the comments/replies layout, where both left and right margins are indented per-thread-level. It’s an (experimental) attempt to ease the “comment chaos” feeling a deeply-threaded discussion can give.
For the theme, threaded comments support kicks off in
functions.php: a function
ocomments() checks if comment threading is available in your WordPress install (i.e., if
wp_list_comments() exists; e.g., if it is running on version 2.7 or greater). If not, the theme loads the 2.6-compatible “old” comments template (
ocomments.php), and comments look and work with no changes from previous versions. If your WordPress supports threading, the theme loads the new threaded comments template.
From there control of the feature moves to
In this execution path,
single.php runs next, and that script includes the
comments.php comments template. If there are comments on the post,
comments.php eventually calls
wp_list_comments() to echo the comments loop, producing the threaded result.
header.php powers the AJAX-ified reply buttons and comment form. (Comment threading will work without this client-side script, but less smoothly.)
There may be a few issues with paging threaded comments and reversing order from ascending to descending that can break “pretty” permalinks, as the page number is not always passed into links on comments page one. This issue, if it’s not just ephemera, appears to be a bug in
wp_list_comments() and most easily patched there. [Conners 2008-12-12]
Wp_list_comments() produces some hCard classes in its comment loop output, but overall, comment author hCards and comment hAtom are less complete in this testing version than in previous versions of Simplish. To re-add the additional microformat stuff, we’ll filter
wp_list_comments(), but this work isn’t started yet.
One place you won’t see threaded comments for a while is here at the Simplish site/blog, nor at the “official” Simplish Demo. Both are hosted on our WordPress-mu-based Labs/Blogs project on the stable version of the multi-blog WordPress software, and MU generally trails wp.org releases and features by a few weeks at least.
Simplish 2.1.4 is planned for final release in conjunction with WordPress version 2.7 — “real soon now.”
Happy [U.S.] Thanksgiving!