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
4,931
Replies
1
Views
5,969
Latest threads
Replies
1
Views
75
Replies
1
Views
174
Replies
4
Views
380
Replies
11
Views
523
Replies
2
Views
228
Recommended threads
Replies
0
Views
1,032
Replies
5
Views
2,166
Replies
4
Views
2,496
Replies
25
Views
9,813

Latest postsNew threads

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