Notifications
Clear all

Show wpDiscuz comments on custom page/php file

4 Posts
2 Users
0 Likes
1,488 Views
(@emreguler)
New Member
Joined: 4 years ago
Posts: 4
Topic starter  

Can I show "wpDiscuz comments & comment form template of a post" in a custom page / php file? 

P.S.= I tried to use comments_template(); and it's not working.


   
Quote
Astghik
(@astgh)
Illustrious Member Admin
Joined: 6 years ago
Posts: 5912
 

Hi @emreguler,

Please check the points mentioned in this doc:

https://wpdiscuz.com/docs/wpdiscuz-documentation/getting-started/missing-comment-form/


   
ReplyQuote
(@emreguler)
New Member
Joined: 4 years ago
Posts: 4
Topic starter  

@astghik , sorry, I forgot to mention that. I already checked that page. Let me tell you more details.

Everything is fine on single post page of that post type. But I want to show the comments of a post on different page. I did it with the codes below. Comments are showing but with default wordpress comments template instead of wpDiscuz...

global $post, $withcomments;
$post = get_post(7617);
$withcomments = 1;
if ( comments_open() && get_comments_number() ) {
     comments_template();
}else{
     _e('Henüz profilinize hiç yorum yapılmamış', 'egrandevu');
}

This post was modified 4 years ago 2 times by emreguler

   
ReplyQuote
Astghik
(@astgh)
Illustrious Member Admin
Joined: 6 years ago
Posts: 5912
 

@emreguler,

then you should use the is_load_wpdiscuz hook and return true for the custom post types.

An example can be found here: https://beta.wpdiscuz.com/docs/codex/filters/is_load_wpdiscuz/

 

 


   
ReplyQuote
Share:
Scroll to top