• vlp

    (@vlp)


    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?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Clicknathan

    (@clicknathan)

    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(); ?>

    Thread Starter vlp

    (@vlp)

    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.

    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?

    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.

    🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘2 comments templates’ is closed to new replies.