New WordPress plugin: Hide-Comments
Here’s a simple plugin for you. I’m compiling a short quiz and, rather than keep a separate note of the answers, have encoded them into the post itself (makes my life easier and I’m all for an easier life). The trouble was, of course, that anyone savvy enough to view the source would be able to get a 100% score with no effort at all and that would never do.
I’ve written a plugin, then, that leaves the comments in the post but strips them out when the post’s displayed. For example, within this post there’s a comment
<-- This is a secret //-->
- just you try and find it.
The plugin, if you’re interested, can be:
- downloaded: em3-hide-comments.zip
- or viewed: em3-hide-comments.txt
Just upload it to your wp-content/plugins directory, activate it and you’re away.
Modified
Author
Daisy says:
Added on December 8th, 2005 at 4:43 pm*steps back in admiration*
I’ve been thinking of switching the Spotlight sidebar to a sideblog for a while now so have installed doocy’s mini-post plugin. Sigh. Any tips on how to get it working? No rush.
Daisy says:
Added on December 8th, 2005 at 4:56 pmYay! I’ve narrowed it down to not knowing what code to add in the sidebar so that the miniposts display.
I’ll keep on thinking but you know, if you’re around…
Em3: Sorry - had dozed off with a mad cat on my lap. The sidebar code is just:
<?php get_mini_posts(); ?>All the other settings are set on the Options/MiniPosts page in Admin.
[slightly later] Actually, I’ve just remembered that I did hack the plugin ever so slightly to get post titles to display. I changed the last line of code in the get_mini_posts() function to read:
echo "\t<li><small><b>$title</b>: $text</small></li>\n";