Is there a way to close back the form to show only the first textarea after the user has submitted? Possibly with the same animation?
Right now I forced a display:none of .wc-form-footer on submit using jquery.
The goal is to show the user a feedback of his comment being posted.
Thanks
Hi @angelochiacchio,
Please follow the steps below:
1. Put the following js code in the js files of the active theme:
wpdiscuzAjaxObj.wpdiscuzSlideUp = function () {
var parent = jQuery('.wc-main-form-wrapper');
jQuery('.commentTextMaxLength', parent).hide();
jQuery('.wc-form-footer', parent).slideUp(wpdiscuzAjaxObj.wpdiscuz_options.enableDropAnimation ? 500 : 0);
jQuery('.wc_comment', parent).focusout();
}
Helpful article: https://www.collectiveray.com/add-javascript-to-wordpress
2. The PHP code below should be put in the active theme's functions.php file:
add_filter("wpdiscuz_comment_post", function ($r){
$r["callbackFunctions"][] = "wpdiscuzSlideUp";
return $r;
});
Thank you,
it doesn't work. Is the procedure the same while using a child theme?
Actually the function is called but not recognized
Please try to add the js code in the wpDiscuz plugin js codes. The wpdiscuz.js file is located in the /wp-content/plugins/wpdiscuz/assets/js/ folder.
Don't forget to remove it from the previous place you've added.
I works now! Thanks a lot!
However in doesn't seem to be working on mobile, which is more important. Any idea why?
Probably this is just a cache issue. Please try on incognito mode. Because mobile browsers have a hard cache, you'll not be able to see the change immediately.
Indeed. It is working fine now. Thank you!
In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.