wpDiscuz - WordPress Comment Plugin
Share:
Notifications
Clear all

How to add specific post comments on specific page?


HNPSK
Posts: 2
Topic starter
(@hnpsk)
New Member
Joined: 8 months ago

Hi there,

I'm using this code and showing the wpdiscuz form with the shortcode and everything is working fine. The only issue is it's showing the current post comments. Can you please let me know how can I show the specific post comments on any page?

function my_wpdiscuz_shortcode() {
$html = "";
if (file_exists(ABSPATH . "wp-content/plugins/wpdiscuz/themes/default/comment-form.php")) {
ob_start();
include_once ABSPATH . "wp-content/plugins/wpdiscuz/themes/default/comment-form.php";
$html = ob_get_clean();
}
return $html;
}
add_shortcode("wpdiscuz_comments", "my_wpdiscuz_shortcode");
2 Replies
Tom
Posts: 444
 Tom
Support
(@tomson)
Support Team
Joined: 6 years ago

Hi @hnpsk,

What are you using shortcodes? If you don't see wpDiscuz comment form you should go through these step instead of using shordcode: https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/missing-comment-form/

wpDiscuz will replace the native comment form automatically. Just make sure it's enabled for the post types and pages in Dashboard > wpDiscuz > Edit Default Form screen. Please read the doc: https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#post-types

If you need to specify a custom comment form to some post or page, you can use this option in the edit comment form screen (make sure you've created new comment form, don't do it for the default comemnt form): https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#comment_form_for_post_id

Reply
HNPSK
Posts: 2
Topic starter
(@hnpsk)
New Member
Joined: 8 months ago

Hi Tom,

Thanks for your quick reply.

My comment form and comments everything is working fine and it's displaying the comments of the current page with this shortcode [wpdiscuz_comments].

I just wanted to show the comments of a specific post. For example please see the shortcode below.

[wpdiscuz_comments post_id="22"]

Where "post_id" parameter fetching the comments of only post id 22. How can I do this with the wpdiscuz plugin? So I can fetch the comments of a specific post. Can you please help me with this?

Thanks!

Reply
Share: