WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] 2 comments templates (11 posts)

  1. katie1
    Member
    Posted 8 years ago #

    Is is possible to have (2)comment templates running on one wordpress install?

    I need one comment template (default will do) for all categories and their specific sub-categories and another comment template designed strictly for one specific category and its sub-categories?

    I've tried designing my own comment template - actually I just copied the default one, changed the HTML wording and renamed it comments-review.php then FTP into my theme folder. I changed the call from <?php comments_template(); ?> to <?php include(TEMPLATEPATH . '/comments-review.php'); ?> in the category.php and sub-category.php template and it worked, sort of.

    I got the comment template form to come up but it displays NO COMMENTS. If I check the specific category.php info section, the comments are registering (ie: 2comments) and clickable, but when I'm re-directed to the comments section I get the form but still no comments.

    However, if I change the template call back to the original code <?php comments_template(); ?> I get everything (form and comments) - but not the new design wording.

    Can someone PLEASE help me with this issue.

    Thank for you help.

  2. error
    Member
    Posted 8 years ago #

    Just call comments_template with your other file, e.g. comments_template('/comments-review.php'); and that's it. You need the / at the beginning. Enjoy!

  3. katie1
    Member
    Posted 8 years ago #

    Happy Christmas it worked like a charm!

    You are brilliant, error. Thanks for your input.!

  4. frankp
    Member
    Posted 8 years ago #

    Sorry - I must be bit dense but I'm trying to do this and I can't follow the above...

    could you walk me thorugh it again?

    thanks!
    Frank

  5. katie1
    Member
    Posted 8 years ago #

    If you want 2 comment templates in your site; then simply copy the existing comment template in its entirety; remane it comments-x or whatever, ftp into your current theme directory and then call this new comment template by simply changing the existing code call <?php comments_template(); ?> in whatever relevant file you want: single category.php or author.php or whatever, with the new comment template name.

    If you change it in single.php, and you do not have other template files, then you will get this newer version instead of the existing one.

    ie: changed comment code call
    <?php include (TEMPLATEPATH . /'comments-x.php'); ?>

    I use two comment templates; one for everyday stuff and commenting, and another fully customised for Reviews as I wanted the words: add your Review; 2 Reviews, etc to show up in the comment output on posts AND the comment template without destroying the existing generic one.

    I use this customised review comment template on a single category.php, namely; Reviews, so that it isn't picked up elsewhere.

    Once you have it being pulled up, where you want it to be displayed, you can then change whatever html (or php output) you want to reflect what it is you're attempting to achieve. I changed headers and stuff so that it reflects Reviews by members.

    Hope this helps.

  6. frankp
    Member
    Posted 8 years ago #

    brilliant, thanks a million - I'm off to try it!

    thanks for the simple and concise explanation!

  7. frankp
    Member
    Posted 8 years ago #

    Your instructions were really clear and made it simple to follow, the only thing was I had to go back to error's comment to realise the changed comment code call had to be:

    <?php comments_template('/enquiries.php'); ?>

    Thanks again for your help!

  8. katie1
    Member
    Posted 8 years ago #

    My mistake - you are right, frankp

    The code should be <?php comments_template('/comments-review.php'); ?>

    Glad I could help :)

  9. Can
    Member
    Posted 8 years ago #

    Is this something that will still appear on the Dashboard once you've made a comment?

    I made the mistake of choosing Page with Comments Template as my For Admins Only template. One admin made a comment, and the link appeared on the Dashboard. I forgot about the Dashboard thing. Password-protecting the page didn't work at all. Because of the commenting part. Which happens to be an important aspect of that section.

  10. katie1
    Member
    Posted 8 years ago #

    @Can - can you please start a new thread.

    Thanx

  11. Can
    Member
    Posted 8 years ago #

    Oh, sorry. I realized, too late, that this topic has already been resolved.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags