comment area in sid...
 

comment area in sidebar?  

  RSS

rob5000
(@rob5000)
New Member
Joined: 1 month ago
Posts: 4
17/10/2019 3:01 am  

Is there a way to put the commenting area on the side of a post in a sidebar? Is there a widget for this?


Quote
Elvina
(@elvina)
Estimable Member Moderator
Joined: 3 months ago
Posts: 181
17/10/2019 5:29 pm  

Hi @rob5000,

Thank you for using wpDiscuz.

You can use the wpDiscuz shortcode in this case.

You should add this code in the functions.php file of the current active theme:

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

Then put the shortcode below  wherever you want:

[wpdiscuz_comments]

You can also use shortcode in theme files add it with do_shortcode function:

<?php
echo do_shortcode("[wpdiscuz_comments]");
?>
This post was modified 1 month ago 4 times by Elvina

ReplyQuote
rob5000
(@rob5000)
New Member
Joined: 1 month ago
Posts: 4
17/10/2019 11:31 pm  

@elvina

Thanks a lot Elvina!  Can you explain to me though how your thirds section relates to the first two parts?

Is it a different option or is it necessary after you include the first two parts?  I want to make sure I am maximizing my ability to incorporate this because I am doing it in two different areas.  First is on post sidebars.  So I would use a widget for that.  But then on a sidebar I create using Divi on a page, would I use shortcode within a text area?  Divi's page sidebar area also lets you use the sidebar you can create with widgets as one of their options... maybe that would be easier?


ReplyQuote
rob5000
(@rob5000)
New Member
Joined: 1 month ago
Posts: 4
18/10/2019 2:07 am  

oh another thing.  This might be cooler.  Is there any widget you can use that can make a text field overlay that I could put the short code?  So basically a button on a page that pops up the comment area as an overlay!?


ReplyQuote
Elvina
(@elvina)
Estimable Member Moderator
Joined: 3 months ago
Posts: 181
18/10/2019 2:12 pm  

Posted by: @rob5000

Thanks a lot Elvina!  Can you explain to me though how your thirds section relates to the first two parts?

Is it a different option or is it necessary after you include the first two parts?

The first part is necessary, then you can use the second or third part of the code, depending on where you want to insert the shortcode:
1. If you need to use shortcode in post content use this:

[wpdiscuz_comments]

2. If you need to use shortcode in theme files, just use the do_shortcode function:

<?php echo do_shortcode("[wpdiscuz_comments]"); ?>

Is there any widget you can use that can make a text field overlay that I could put the short code?

I' really sorry but wpDiscuz doesn't have a widget to make a text field overlay. Maybe Wordpress has such a feature. You should ask this question in the WordPress forum:

https://wordpress.org/support/forums/


ReplyQuote
Bassem
(@bassem)
Active Member
Joined: 1 month ago
Posts: 6
18/10/2019 3:22 pm  
@elvina,
function my_wpdiscuz_shortcode() {
if (file_exists(ABSPATH . 'wp-content/plugins/wpdiscuz/templates/comment/comment-form.php')) {
ob_start();
include_once ABSPATH . 'wp-content/plugins/wpdiscuz/templates/comment/comment-form.php';
return ob_get_clean();
}
} add_shortcode('wpdiscuz_comments', 'my_wpdiscuz_shortcode');

I added this code in the function.php for the active theme then i got the shortcode 

"[wpdiscuz_comments]"

in the page i want but it showed nothing!

I tried to change the theme to twenty Nineteen and tried but still not working , Also tried to add the shortcode in the footer widget and nothing show!
Is there something i should do in the plugin setting ?

This post was modified 1 month ago 2 times by Elvina

ReplyQuote
rob5000
(@rob5000)
New Member
Joined: 1 month ago
Posts: 4
18/10/2019 6:39 pm  

 @elvina @bassem

Same here Elvina.  My code works fine when I use it in a post area.  But when I insert code into a code module (I could use a text body area and insert code into text area over visual), it actually only works on mobile.  Also I don't think it will be worth it to keep there regardless, if it isn't possible to exclude user pictures to give about 1/4 of the room of my sidebar more open space for the actual comment.


ReplyQuote
Elvina
(@elvina)
Estimable Member Moderator
Joined: 3 months ago
Posts: 181
19/10/2019 1:16 pm  

@bassem,

The shortcode works correctly. Maybe you use it the wrong way?

You should use shortcode without quotation mark(""):

 [wpdiscuz_comments]

in the page i want but it showed nothing!

In case if you want show comment form on the page, you don't need shortcodes, just edit the Default form, and make sure that the comment is enabled for page.
More info here: https://wpdiscuz.com/docs/wpdiscuz-documentation/getting-started/custom-comment-form/comment-form-settings/#post-types

Note: On the page make sure " Allow comments" is enabled.

 


ReplyQuote
Bassem
(@bassem)
Active Member
Joined: 1 month ago
Posts: 6
19/10/2019 1:28 pm  

Hi,

I am using the code correctly as i copy and paste it 
I want to show the comment box in a section at this page https://bdc-activations.com above the contact us section 

Screen shot


ReplyQuote
Elvina
(@elvina)
Estimable Member Moderator
Joined: 3 months ago
Posts: 181
19/10/2019 2:08 pm  

@bassem,

In your active theme  page.php file find comments_template() function, then put it on comment (/**/). The issue should be solved.

This post was modified 1 month ago by Elvina

ReplyQuote
Elvina
(@elvina)
Estimable Member Moderator
Joined: 3 months ago
Posts: 181
19/10/2019 3:16 pm  
Posted by: @rob5000

My code works fine when I use it in a post area.  But when I insert code into a code module (I could use a text body area and insert code into text area over visual), it actually only works on mobile. 

If it works on mobile, it should work on desktop too. Please make sure you enable it on desktop. 

Also I don't think it will be worth it to keep there regardless, if it isn't possible to exclude user pictures to give about 1/4 of the room of my sidebar more open space for the actual comment.

Please navigate to Dashboard > Comments > Settings >Styling admin page, put the following CSS code in the "Custom CSS code" textarea:

#wpcomm .wc-field-avatararea .avatar{
display:none !important;
}

Don't forget to press CTRL+F5(twice) on the front-end before checking.

 


ReplyQuote
Bassem
(@bassem)
Active Member
Joined: 1 month ago
Posts: 6
19/10/2019 3:53 pm  
Posted by: @elvina

@bassem,

In your active theme  page.php file find comments_template() function, then put it on comment (/**/). The issue should be solved.

Thanks you so much, You really so helpful Smile


ReplyQuote
Share:
Green
Default
Pear
Black Emo
{green}:grinning:
{green}:wink:
{green}:face:
{green}:inlove:
{green}:sweaty:
{green}:surprised:
{green}:lovekiss:
{green}:laugh:
{green}:formalsmile:
{green}:displeased:
{green}:cool:
{green}:resent:
{green}:nerd:
{green}:screaming:
{green}:amazed:
{green}:sad:
{green}:deceitful:
{green}:starryeyes:
{green}:evil:
{green}:shocked:
{green}:tears:
{green}:sulky:
{green}:smile:
{green}:vomited:
{green}:hi:
{green}:afraid:
{green}:crazy:
{green}:rabid:
{green}:fighting:
{green}:nonoise:
{green}:blushed:
{green}:idontknow:
{green}:scared:
{green}:razz:
{green}:kiss:
{green}:eat:
{green}:shutmouth:
{green}:gape:
{green}:suspicious:
{green}:laughingoutloud:
{green}:bruise:
{green}:crying:
{green}:pray:
{green}:serious:
{green}:excitement:
:)
:d
:wink:
:mrgreen:
:neutral:
:twisted:
:arrow:
:shock:
:???:
:cool:
:evil:
:oops:
:razz:
:roll:
:cry:
:eek:
:lol:
:mad:
:sad:
:!:
:?:
:idea:
:hmm:
:beg:
:whew:
:chuckle:
:silly:
:envy:
:shutmouth:
{pear}:happy:
{pear}:smile:
{pear}:laugh:
{pear}:laughingoutloud:
{pear}:crying:
{pear}:exhausted:
{pear}:nerd:
{pear}:surprised:
{pear}:veryhungry:
{pear}:wink:
{blackemo}:laughtertotears:
{blackemo}:gift:
{blackemo}:love:
{blackemo}:inlove:
{blackemo}:shamefaced:
{blackemo}:heart:
{blackemo}:crazy:
{blackemo}:anguished:
{blackemo}:bruise:
{blackemo}:easymoney:
{blackemo}:exhausted:
{blackemo}:vampire:
{blackemo}:shutmouth:
{blackemo}:wink:
{blackemo}:carnival:
{blackemo}:flowers:
{blackemo}:hotdrink:
{blackemo}:party: