The effects of alcohol on
sustanon 250 leucine for – real weight loss & bodybuilding benefits?
[Solved] wpDiscuz 7 shortcode [wpdiscuz comments]
(@a01new)
Active Member
Joined: 6 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
(@taron)
Eminent Member
Joined: 6 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");
(@starapple)
Joined: 5 years ago
New Member
Posts: 3
Jul 05, 2020 8:35 pm
@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)
Joined: 8 years ago
Illustrious Member
Posts: 8187
Jul 06, 2020 7:49 am
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: 5 years ago
New Member
Posts: 3
Jul 06, 2020 3:55 pm
@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: 5 years ago
Active Member
Posts: 4
Nov 17, 2020 3:46 pm
@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)
Joined: 8 years ago
Illustrious Member
Posts: 8187
Nov 18, 2020 8:24 am
(@lisa-ramish)
Active Member
Joined: 5 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/
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8187
Jul 09, 2020 10:39 am
(@starapple)
Joined: 5 years ago
New Member
Posts: 3
Jul 09, 2020 2:32 pm
@lisa-ramish, is this a genuine support post? Why am I redirected to Facebook from that link in your post?
(@lisa-ramish)
Joined: 5 years ago
Active Member
Posts: 5
Jul 09, 2020 2:36 pm
@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.