Do you want to display WordPress comments on a new page and separate 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 switched to this new comment system on our site in the last week and have been tweaking it. We now have new comments pages for every post. See this example comments page below –
Here is how to do it for your site –
1. Remove old comment 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. 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 many 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. New Comments Page
Then you need to create a new fileÂ which 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 comments system from the comments-popup.php .
This is the same file which 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 theÂ 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. Post a comment and see.
Also Read – why this helpful to remove user generated content from Google index and fix Google Panda penalties.