Do you want to display WordPress comments on a new page and separate it from post content? I explained earlier how to install WordPress pop-up comments easily. Now try this tip which will open WordPress comments on a different page, and not a pop-up window.
This code works as a custom modification of the WordPress pop-up comments script and link code. We temporarily switched to this new comment system on our site and have been tweaking it. We now have new comments pages for every post if you are seeing this post in the test phase. See this example comments page below –
Here is how to do it for your site in 3 easy steps…
1. Remove old comments system
Firstly you need to remove your original comment system from the single.php post page. This is essential to avoid reduplication of comments on both pages. This will typically look like this code.
<?php comments_template('', true); ?>
2. Create New Comments Link
Next, you need to install a link, which when clicked will lead you to the new comment system page. Here is how we have installed the code on our website.
<a href="http://yourdomain.com/?comments_popup=<?php the_ID(); ?>" class="btn btn-primary"> <?php comments_number('No Comments', '1 Comment', '% Comments'); ?></a>
Here again, we use the post ID to get the post. Then we use btn Classes using bootstrap to create a beautiful blue button. The link has three-part variables which will display when there are no comments, one comment, or any comments. You can choose to edit these three variables to show whatever content you like when these three comment situations are present. We prefer to add a post comment text also along with this link.
3. Create New Comments Page
Then you need to create a new file that will host all comments for the particular post. Here again you need to create new PHP file without FTP in your themes folder directly from WordPress admin. Since this is a blank PHP file, you need to source the comments system from the comments-popup.php .
This is the same file that was used to source content for the pop-up comments page. This file is typically located in/wp-includes/theme-compat/comments-popup.php. You can also find the source code for this file on Github.
So we have basically tweaked the WordPress popup comment system and used it as new pages on your website. Now your WordPress comments are on a different page and separate from a post content and you can style and edit this file as per your WordPress theme provides seamless integration with your site.
You can see this particular comment system live on our blog right now if you are seeing in the test phase. Post a comment and see.
Also Read – Why this helpful to remove user generated content from Google index and fix Google Panda penalties.