• Resolved ljkerley

    (@ljkerley)


    Hi there:-
    I am trying to implement reader comments. The desired design is that I would get a total number of comments, but as a default the comments are hidden. By clicking on the number of comments, the comments are revealed on the page. I see this design on many blogs including the default and classic themes. So I used the same code I saw in other themes, but it doesn’t seem to work. The function does return the number of comments, but clicking on the link doesn’t hide/show the comments. The comments always appear. I have both a comments.php and a comments-popup.php in my theme.

    I have now spent 4 hours trying to fix this. I have read docs, forums and compared to other themes to no avail. I am wondering if I need to install a plug-in or do something not-so-obvious to get this to work. Below is a piece of code.
    If someone could help, I would appreciate it. Thanks.

    <div id=”commentStatus”>
    <h3 class=”commentsHeading”>Reader comments:
    <span class=”commentsCounter”><?php comments_popup_link(‘0’, ‘1’, ‘%’); ?><span>
    </h3>

    <?php comments_template(); // Get wp-comments.php template ?>
    </div>

    <?php endwhile; else: ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • You need jQuery to dynamically hide/show content, like this plugin, among others.

    Thread Starter ljkerley

    (@ljkerley)

    Hi Songdogtech,
    The solution you linked me with was a bit more heavy-weight than I needed. However, thanks for the idea. If I get more activity on my site, I may eventually implement the solution you pointed me to. Meanwhile, I found a great tutorial on comments. I would recommend it not for yourself as you are more in-the-know than I am. But for any WP beginner this tutorial is great.
    LK

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘<?php comments_popup_link(‘0’, ‘1’, ‘%’); ?> not working’ is closed to new replies.