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!
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'; }
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!
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:
Do I need to change something or is it a Divi issue?
Hi theplacetobe,
I'm sorry but we can't support such issues. We're not familiar with 3rd party solution you use with wpDiscuz.
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' );
If I need to do something else, please tell me.
- Otherwise, please provide feedback on what goes wrong here.
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.
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>
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/