WordPress.org

Ready to get started?Download WordPress

Forums

2 comments templates (5 posts)

  1. vlp
    Member
    Posted 6 years ago #

    Hi,
    I want to use 2 different styles of comments, but I cannot figure out if there is possibility to use 2 templates for comments.

    Anybody has an idea?

  2. Clicknathan
    Member
    Posted 6 years ago #

    This is likely possible, depending on how exactly you plan on implementing it.

    For example, do you want different types of templates depending on whether a user is on a Page vs. a Post, or whether a user is in the archives vs. the main blog page, or some other scenario?

    That will be the first step to providing an answer, however the second part should be pretty easy.

    Just create a copy of comments.php (maybe comments2.php) and then call it manually using the following code:

    <?php include (TEMPLATEPATH . '/comments2.php'); ?>

    In place of:

    <?php comments_template(); ?>

  3. vlp
    Member
    Posted 6 years ago #

    Hi,

    the situation is:

    all post categories use comments.php as comments template and I need one post category to use different styles.

    I tried your advice (I try it before but I check again now), and it doesn't work. I changed all comments.php for comments2.php in that file.

    When I submit a comment it doesn't show anywhere.

  4. af3
    Member
    Posted 5 years ago #

    tried the above and it doesnt work. seems like that script is trying to get the recent entries; with the comment text not shown.

    any idea how to fix this?

  5. WPITn2shape
    Member
    Posted 5 years ago #

    Hmmmmm try using conditional tags (php if), search this site for more info.

    It seems like that should work well for what you want.

    You put in code for if it's that category, show this, else, the regular.

    :-)

Topic Closed

This topic has been closed to new replies.

About this Topic