In order to allow comments to be left on each individual file or folder, I had to use a little trick. Whenever a user leaves a comment on a given file or folder, the comment is actually left on the WordPress Page that the gallery resides on. If you go into your Admin panel under Manage > Comments, you’ll see all the comments for the gallery page.
In order tell what picture or folder a comment was left on, I store the name of the file or folder in the text of the comment within an HTML-style comment. The HTML-style comment is not displayed in the browser (because it’s a comment, of course). In that comment, I put the path to the image or folder, as shown here:
<!--lazy-k-gallery-comment:Animals/P0000199.JPG-->This is a nice picture.
If you want to move a comment, you’ll have to edit that path. Note, since I’m using an HTML comment, you may not see that comment if you’re using the WYSIWYG editor. To see the HTML source, click the “HTML” button on the toolbar.
2. There’s no comments section on my gallery page. Why not?
Many themes are set up to allow commenting on posts but not on pages by default. This isn’t a problem specific to this plugin – it’s just a matter of configuring WordPress to do what you want. First of all, make sure the “Allow Comments” checkbox is set on your page.
If that doesn’t do the trick, we need to add the comments section to your page template. Edit the following file within your WordPress installation: wp-content/themes/default/page.php. If you are using a theme other than “default”, edit the file within that theme’s folder instead. You could also edit this file from your admin panel by choosing Presentation > Theme Editor > Page Template.
In that file, you probably have something like this near the beginning:
<?php (have_posts()) : while (have_posts()) : the_post(); ?>.
Near the bottom you should have something like this:
<?php endwhile; else: ?>.
The “while” and “endwhile” mark the beginning and end of your “loop”. All you need to do is add the following line right before the end of your loop, right before <?php endwhile; else: ?>.
<?php comments_template(); ?>
Now, if you view your pages, each one should have the comments section at the bottom. If you don’t want to allow commenting on some pages, just edit the page and uncheck the “Allow Comments” checkbox.
3. Why do all my comments show up on the root of the gallery instead of on the pictures?
First of all, make sure you added the line to the comments template as listed in the installation instructions. If you did that properly, I’m suspicious of your theme… Here’s what to do.
Submit a comment for a picture in your gallery. It’ll show up on the root instead (that’s what you told me, anway).
Go take a look at the comment in the Admin Panel. Instruction are above in the “How do I manage comments assigned to photos?” section.
Do you see the <–lazy-k-comment:–> stuff? If not, your theme is missing a required line.
Edit your comments template (see instructions above) and see if this line is present:
<?php do_action('comment_form', $post->ID); ?>
If not, it should be right before </form>
Thanks to Thomas for helping me find this problem.
4. Can’t you just show me an example of your comments and page templates?
Sure. Here are the comment and page templates for the default theme included with WordPress 2.0. Just look for the text “Lazy-K Gallery” to find the important parts. If those don’t help, just drop me a line- I’m happy to help out.
5. How can I get your plugin to work with Lightbox or Thickbox?
There are a number of downloads going by those names. I’ve tried a bunch of them and listed the results below. Install the one you want using the instructions on the links below and choose how you want it to be used from the Lazy-K Gallery options page.
If you find other image viewing scripts that work like these, let me know what they are.
6. Why are my thumbnails so tiny?
Are you using the K2 theme or one derived from it? Take a look at this discussion. I’ll need to learn a little more about CSS if I’m to fix the problem on my end, so if you know of a change I can make to MY code, let me know.
10 Responses to “Frequently Asked Questions”
Comments on this page are no longer allowed. If you have a question or comment please see the support forums.