Support » Plugins » Comments on a seperate page

  • I’m looking for a way to get comments to appear on a seperate page that the individual posts page.

    In other words you have the post page then at the bottom a link to comments on that post.

    If anyone has an answer I’d greatly appreciate it.

Viewing 1 replies (of 1 total)
  • Here’s a quick 4-step hack for one way to implement this:

    1. The link:

    <a href="<?php the_permalink(); ?>?comments=1">View Comments</a>

    (Note: Change the last part of the url to &comments=1 if you do *not* use custom permalinks.)

    2. Surround The Loop in your single post template (typically single.php) with the following if statement:

    <?php if( !(isset($_GET['comments']) && $_GET['comments'] == 1) ) : ?>

    ~ The Loop goes here ~

    <?php endif; ?>

    (Note: You may want to modify this somewhat so part of The Loop, say the post title, still displays when viewing comments.)

    3. Change the comments_template() template tag in your single post template to:

    <?php if($_GET['comments'] == 1) comments_template(); ?>

    4. There is no step 4.

    Lots of ways this could be played with… A warning though: internally WordPress knows nothing about what we’re doing here, so redirects on comment submissions will still end up on the main permalink (sans our comments append). This would have to be dealt with, somehow (I guess you might consider this step 4).

Viewing 1 replies (of 1 total)
  • The topic ‘Comments on a seperate page’ is closed to new replies.