Notifications
Clear all

How can I insert wpDiscuz into a page as a standalone comment wall - i.e. detached from any WP Post?

9 Posts
6 Users
3 Likes
20.3 K Views
(@rcshep)
New Member
Joined: 8 years ago
Posts: 2
Topic starter  

Since a shortcode for wpDiscuz evidently does not exist, how (specifically) can I insert the wpDiscuz capabilities into whatever part of a page I choose solely as a standalone "comment wall" - i.e. independent of and NOT attached to any WP post?  I can easily do this with the Facebook, Disqus, and other comment plugin shortcodes but very much want to do this with wpDiscuz instead.  I'm using the Total theme and Users Ultra.  Thank you very much for your help!


   
Quote
 Tom
(@tomson)
Famed Member Admin
Joined: 9 years ago
Posts: 4172
 

You can create wpDiscuz shortcode. Put this code in active theme `functions.php` file:

function my_wpdiscuz_shortcode() {
   if(file_exists(ABSPATH . 'wp-content/plugins/wpdiscuz/templates/comment/comment-form.php')){
      include_once ABSPATH . 'wp-content/plugins/wpdiscuz/templates/comment/comment-form.php';
   }
}
add_shortcode( 'wpdiscuz_comments', 'my_wpdiscuz_shortcode' );

and then you can try to use this shortcode: [wpdiscuz_comments]

Please note: WordPress Comment system is designed to be loaded on single post/page, it's not designed for archive pages like Categories, Tags, Author, Search, etc... So make sure you don't load widget with this shortcode on non-single (archive) pages.

In WordPress Template file you can use:

<?php comments_template() ?>

or

if(file_exists(ABSPATH . 'wp-content/plugins/wpdiscuz/templates/comment/comment-form.php')){
      include_once ABSPATH . 'wp-content/plugins/wpdiscuz/templates/comment/comment-form.php';
}

   
Della and rcshep reacted
ReplyQuote
(@rcshep)
New Member
Joined: 8 years ago
Posts: 2
Topic starter  

Everything seems to work well just after install - will let you know if I run into any issues during testing it further - THANK YOU very much for your help - greatly appreciated!


   
ReplyQuote
(@theplacetobe)
Active Member
Joined: 8 years ago
Posts: 17
 

I have added the shortcode to my WP site using latest releases of WP and Divi from Elegant Theme.

It provides a Page Builder where I can define rows and columns.

I set up a row with 3 columns and put the shortcode in the middle column.

Unfortunately, it does not work.

Comments are displayed, but not in the column in the middle, there are above the columns:

see live example here

Do I need to change something or is it a Divi issue?


   
ReplyQuote
 Tom
(@tomson)
Famed Member Admin
Joined: 9 years ago
Posts: 4172
 

Hi theplacetobe,

I'm sorry but we can't support such issues. We're not familiar with 3rd party solution you use with wpDiscuz.


   
ReplyQuote
(@Anonymous)
New Member
Joined: 1 second ago
Posts: 0
 

I understand that you may not support with third party theme.

So I made a test with theme Twenty16 from wordpress.org, and I got exactly the same problem.

You will find attached a copy of the page in the WP editor, and the page displayed.

I just added the code of the shortcode in functions.php of the theme:

function my_wpdiscuz_shortcode() {
   if(file_exists(ABSPATH . 'wp-content/plugins/wpdiscuz/templates/comment/comment-form.php')){
      include_once ABSPATH . 'wp-content/plugins/wpdiscuz/templates/comment/comment-form.php';
   }
}
add_shortcode( 'wpdiscuz_comments', 'my_wpdiscuz_shortcode' );
page displayed
page in wp editor

If I need to do something else, please tell me.

  1. Otherwise, please provide feedback on what goes wrong here.

   
ReplyQuote
 Tom
(@tomson)
Famed Member Admin
Joined: 9 years ago
Posts: 4172
 

You're loading wpDiscuz in post content wrapper, so you get that.  Comment box should be loaded outside of post content, just below. It's would be better to add <?php comments_template() ?> in post template file instead of adding shortcode (more info>). This shortcode is only for very specific cases if the user understand how can style page layout to make it correct. wpDiscuz is not designed to use with shortcode, wpDiscuz should replaces the default comment automatically. Make sure your default comments are there and work correct, then install wpDiscuz.


   
Della reacted
ReplyQuote
(@wt8171)
New Member
Joined: 5 years ago
Posts: 2
 

I added the code to my functions.php file, then I added the shortcode to the section where I want the standalone comment box to show up and its blank (see picture).  Any help?

<div class="column middle" style="background-color:white;">
<h2 style="color: #590000;"><center>Comments</center></h2>
[wpdiscuz_comments]
</div>

 

screen shot comments

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

Hi @wt8171,

Please make sure you don't load this shortcode on non-single (archive) pages. The wpDiscuz is designed to be loaded on a single post/page, it's not designed for archive pages like Categories, Tags, Author, Search, etc... 

I'd also suggest you check out the points mentioned in this doc: https://wpdiscuz.com/docs/wpdiscuz-documentation/getting-started/missing-comment-form/


   
ReplyQuote
Share:
Scroll to top