Shortcode for wpdiscuz
-
Hello. Please make a shortcode to insert a comment form anywhere on the page.
Thank you.
-
Hi,
The code for the shortocde was working in the older plugin version. However, since the lastest updated the shortcode is not showing up anymore.
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’);Thanks
Hello
I’ve used the following code for shortcodes before and it worked fine!!!!!
But now!
after updating the plugin, this code dose not works and the commentes are not displayed!!!!function my_wpdiscuz_shortcode() { if(file_exists(ABSPATH . 'wp-contents/plugins/wpdiscuz/templates/comment/comment-form.php')){ include_once ABSPATH . 'wp-contents/plugins/wpdiscuz/templates/comment/comment-form.php'; } } add_shortcode( 'wpdiscuz_comments', 'my_wpdiscuz_shortcode' );
-
This reply was modified 4 years, 9 months ago by
Bakhshi.
Hi @bakhshi,
The code is changed, you should remove the old code and use the code mentioned in this support topic: https://wpdiscuz.com/community/plugin-update-issues/problem-wpdiscuz-comments/#post-595Hi, I’d like to add discuz in a woocommerce tab. Will this shortcode work?
Hi @tompalmer999,
I’d recommend WooDiscuz Plugin.
wpDiscuz can only replace your Review Tab, there is no way to add it in another Tab. if you replace the Review Tab with wpDiscuz, you should create a new comment form with Rating custom field like it’s explained here: https://wpdiscuz.com/docs/wpdiscuz-7/getting-started/manage-comment-forms/comment-form-settings/#post-types@gvectors-team, is it possible to just integrate the shortcode function into the plugin rather than making it by inserting it in functions.php?
I need the option because I’m using the free version of Elementor that doesn’t play well with creating a post and doesn’t add the default comment box beneath the post. My only choice is to find either a widget or element that can be dragged on the post’s canvas.
Accessing the shortcode via functions.php means it has to be redone for each template a site owner/admin might maintain.
Regards.
Hi everybody,
experience to add Shortcut in Avada Theme?
I tried now all proposals to add code in headers.php, comments.php, shortcuts.php, functions.php.
Because sometimes, the filename was no mentioned its possible that I chosed the wrong one. I looks like that I am doing something wrong, but no idea what.
Please help.
Thank you.
Kind regards
Florian
@camperhelp, your question is vague and it’s not clear if it’s about using the shortcode snippet posted earlier. Questions about a specific theme should be to the theme’s author.
It is not recommended to edit WordPress files. Any code additions should appropriately be in functions.php or by using a plugin that allows functions that are accessible to all themes.
-
This reply was modified 4 years, 7 months ago by
starapple.
Plugin is not working on my website. I tried every method…Help me ASAP… It’s working on the elementor edit section…and when I check the post then there form is missing. I use this code in Code snippets plugin… and also using shortcode [wpdiscuz_comments] in custom elementor blog post.. it doesn’t work…
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”);-
This reply was modified 4 years, 5 months ago by
Yui.
-
This reply was modified 4 years, 5 months ago by
techyshaala.
Can someone please update on the above:
I want to add wpdiscuz as a short code to a custom single post page for new posts and custom new posts.
However, the provided shortcode: [wpdiscuz_comments] does not work (also not on normal single post pages)
I work with Brizy builder, however: cannot find a comments.php file in the brizy plugin directory, so the code provided by @myriad58 : is it still up to date? Where can I place it?
It would be much appreciated if the plugin makers and/or experienced users can help out with providing the right shortcode/code to make this work.
Kind regards,
Brian
Hey Brian:
I think you are out of luck. In late December Brizy released an update that completely broke wpdiscuz functionality and as a result I moved to a different templating sw. Sorry.
Please open a new support topic in the wpDiscuz.com community.
@myriad58 thanks for replying
@zubo2 I am currently using wpforo and I want to include a third party plugin’s short code inside wpforo topic page.
The requirement is to remove leave a reply section and use any third party comments plugin in it
Can you help me what I have to do?
@jeyantharkumar I think you need to ask your question in the wpforo forum.
For those still interested, this is what has been working for me, which I place in a plugin rather than the theme’s functions.php so that tbe shortcode is available independent of the theme being used.
/** * wpDiscuz shortcode */ 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");
-
This reply was modified 4 years, 9 months ago by
- The topic ‘Shortcode for wpdiscuz’ is closed to new replies.