Show comments in Wordpress category?

justsmallsteps

Member
Registered
Joined
Mar 11, 2014
Messages
38
Points
8
I'm trying to add comment form from single page in WP into categories page but it didn't work although I added
<?php comments_template( '', true ); ?>
Are there any ways to show comments in Wordpress category?
 

freds86

Member
Registered
Joined
Mar 13, 2014
Messages
49
Points
0
I'm trying to add comment form from single page in WP into categories page but it didn't work although I added

Are there any ways to show comments in Wordpress category?
Go to category.php file in your wordpress theme and add these codes
Code:
<?php
$wp_query->is_single = true;
comments_template();
$wp_query->is_single = false;
?>
This makes wordpress think it's on staying single page or page query so It will show comment box/comments as your requirements.
 

justsmallsteps

Member
Registered
Joined
Mar 11, 2014
Messages
38
Points
8
@freds86
It worked as well. Comment box showed but comments displayed on post page instead of category page :(
 

msWendy

Member
Registered
Joined
Mar 13, 2014
Messages
16
Points
0
msWendy
Wordpress is only support comments for posts and pages, not categories. If you're afraid of duplicating comment on categories and posts, just hiding comment template command on single page and still show on categories, that's would help you solve the problem. :eek:
 

Malcolmjr96

Moderator
Staff Member
Joined
Apr 18, 2016
Messages
433
Points
28
Just checking in! Have you found an answer to your question?
 

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top