One of the things I wanted to do was be able to highlight certain posts that were particularly important. Probably not useful on all types of blogs – but on this one, where some comments with links, or suggestions, or alternate methods of doing something, may go unnoticed in a busy, highly commented post, I wanted to be able to point to a few and make sure people saw them…
I had actually originally asked MooKitty for a plugin/hack that would do it:
Here is her script.
I think her solution is very well-done. It means updates to the interface so you can easily see which post was noted as "important", etc. However, after having lived through a few MT upgrades, I've been trying to avoid editing any core WordPress code, so that I don't have to start worrying about a dozen hacks I could lose when I upgrade my CMS.
Here's my solution. It may not be as elegant, but it gets the job done.
On your wp-comments.php file, after this line of code:
<?php foreach ($comments as $comment) { ?>
Add the following:
<?php
$isImportant = false;
if (stristr($comment->comment_content, "<!–important–>")) {
$isImportant = true;
} ?>
Then before your comment text begins (with <?php comment_text() ?>) add this:
<?php if($isImportant) { echo '<div class="importantcomment">';} ?>
To close the DIV tag – BEFORE the ending LI tag for the comment add this
<?php if($isImportant) { echo '</div>';} ?>
Then add a style "importantcomment" to your style sheet. Style however you like.
When you want to mark a comment as "important" simply edit it and in the very beginning of the comment add this:
<!–important–>
The kind of neat thing is, I can see an easy hack/addition to this where you could have "levels" of importance – with each level having a different style.
The drawbacks of my idea vs. MooKitty's is that with mine, techincally anyone can add the "important" text to their comment, and make theirs stand out. (You would just need to edit it to remove the important notation – if you wanted to). As well, without looking at your blog, or clicking edit on each comment, there's no easy way to tell from the comment listing pages which comments have been marked as important – like you can with hers.
So, pick your poison, I guess. But wanted to show you both options.