The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
wpDiscuz 7 shortcod...
 
Share:
Notifications
Clear all

[Solved] wpDiscuz 7 shortcode [wpdiscuz comments]

11 Posts
6 Users
1 Reactions
11.6 K Views
Posts: 2
Topic starter
(@a01new)
Active Member
Joined: 4 years ago

Hello

I have a problem with the new update version 7

I used this code [wpdiscuz_comments] but with this update it no longer works

10 Replies
Posts: 36
(@taron)
Eminent Member
Joined: 5 years ago

Hi @a01new.

Please use this code instead of the old one.


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");
5 Replies
(@starapple)
Joined: 4 years ago

New Member
Posts: 3

@taron, I'd like to suggest that this function be put into the plugin rather than be something to be added to functions.php. When a site owner/admin changes a theme, this has to be done all over in the new functions file.

In my case, I'm using Elementor to create some posts that benefit from special layout; but Elementod does not add an option to include a comment form--at least not in the free version. Using a plugin or a widget element is the only way to include a comment form on a single post created using Elementor--and probably other block design plugins.

This shortcode gives content creators a nice way to create single posts with a comment form.

All the best.

Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7573

Thank you for suggestion @starapple

This is just a workaround in cases if the shortcode is required. We'll need to make a lot of changes in the plugin codes to add this in the plugin codes. However, we'll take into consideration for future updates.

(@starapple)
Joined: 4 years ago

New Member
Posts: 3

@asti, I'm familiar enough with WordPress plugins to know that all it take is pasting the above code at the correct place. In fact, the only reason I use it in the theme's functions file and not in the plugin, is that when you send out new updates I'd lose the function. I successfully tested it in the plugin myself but decided against that approach.

(@trebuag)
Joined: 4 years ago

Active Member
Posts: 4

@taron

Hi Taron,

I'm working on a elearning wp website. the lecon pages don't have the "add comments" option by default. I've copied your code and wpdiscuz works well on every pages wp comment would have worked but not under my lecon pages where I have my videos and textes to comment.

the lecon pages are managed with membership and roles

(I'm using elementor edit in case it's change anything)

any sugestion ?

Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7573

@trebuag,

Please follow this support topic: https://wpdiscuz.com/community/postid/5507/

Posts: 5
(@lisa-ramish)
Active Member
Joined: 4 years ago

I pasted that code in my functions.php and the shortcode works in the body of a lesson now (in fact, it appears twice). But I can't get it to work in my sidebar even though I can get other shortcodes to work using a text widget. Here's a sample page:  http://kippdcmath.com/.../overview-of-kipp-dc-math-10-min/

3 Replies
Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7573

@lisa-ramish,

Please follow this support topic: https://wpdiscuz.com/community/troubleshooting/embed-comment-section-in-a-sidebar/#post-2714

(@starapple)
Joined: 4 years ago

New Member
Posts: 3

@lisa-ramish, is this a genuine support post? Why am I redirected to Facebook from that link in your post?

(@lisa-ramish)
Joined: 4 years ago

Active Member
Posts: 5

@starapple I'm sorry! I posted for help on a facebook forum that I am a part of and just copied this from there. This is the link without facebook messing with it: http://kippdcmath.com/lessons/overview-of-kipp-dc-math-10-min/

I saw Asti's link to add a shortcode widget but other shortcodes are working in my sidebar so I don't see why that's necessary.

Share: