Show comments in Wordpress category?

justsmallsteps

New member
Joined
Mar 11, 2014
Messages
29
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
<?php comments_template( '', true ); ?>
Are there any ways to show comments in Wordpress category?
 

freds86

Member
Joined
Mar 13, 2014
Messages
85
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

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

New member
Joined
Mar 11, 2014
Messages
29
Points
0
@freds86
It worked as well. Comment box showed but comments displayed on post page instead of category page :(
 

msWendy

New member
Joined
Mar 13, 2014
Messages
26
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:
 
Older threads
Replies
9
Views
5,422
Replies
1
Views
7,052
Recommended threads
Replies
1
Views
2,786
Replies
0
Views
2,445
Replies
5
Views
2,849
Replies
3
Views
5,715
Replies
3
Views
3,055

Referral contests

Referral link for :

Sponsors

Popular tags

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