At the Whiny Expat Blogger MeetUp this weekend, my second favorite nameless roommate (they all tied for second and you know who #1 was) remarked that I could expect more frequent comments on my blog if only the timestamp wouldn’t indicate that said roomie was actually shirking more professional duties.
“No problem,” I thought. “That’s probably just a simple config setting or at most a template tweak. Who needs to see a timestamp on a comment other than the blog owner anyways? Surely a datestamp is granular enough.”
It was harder than I thought, but far from impossible. There’s no global parameter in WordPress to define comment timestamp style specifically — you can define timestamp styles for your blog in general, but not for comments specifically. And when I looked under the hood at my template’s single.php and comments.php template files, nothing leapt out at me. Googling for terms like “wordpress comment timestamp” yielded nothing promising, either — the hits returned all seemed to be hints about the general date/time format or template edits for the display of the post’s timestamp. Looking up wp_list_comments() however, I struck gold.
The secret is using the wp_list_comments() function with arguments telling it to use a callback function in order to display the comments in a non-standard way. You have to write that callback function and save it into your template’s functions.php as well for this to work. The example on the codex is a great way to get started.
I’ve got it working here on the Senanque theme; give it a try — leave a comment and you’ll see the date on your comment, but not the time. Note: I also did a template tweak on the post’s timestamp. I suppose the especially nosey boss might infer slackery from the timestamp on the post even if the comment is un-timestamped if he can guess the timezone I’m using (duh…what country is this?) and see that his employee has commented here during what must have been the workday.