I was super happy with you previous version, however, I did have a trouble with using it with OptimizePress pages. However, the code below fixed thouse issues:
function my_wpdiscuz_shortcode() {
$html = "";
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';
$html = ob_get_clean();
}
return $html;
}
add_shortcode( 'wpdiscuz_comments', 'my_wpdiscuz_shortcode' );
I do know that the URL to comment-form.php has changed, however, substituting the address to
wp-content/plugins/wpdiscuz/themes/default/comment-form.php doesn't really help. The comment form appears on the page, but styling is COMPLETELY broken. Can you suggest any workarounds with it?
The folder structure has also changed in the new version, and now you have separate CSS folder (which is not loading correctly). Do you have any idea how to change the code above so that it works?
Hi @dennis777,
First of all, you should use the following new 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");
Also, you should make sure all points mentioned here are set correctly, i.e. the comments should be enabled for that page.
Important: Just ignore the last point (Fixing Tip 6). In your case the <?php comments_template() ?> WordPress template function, shouldn't be used.
P.S. I do know that it's not your issue, since the comments work perfect without OptimizePress, but since it was possible to use the shortcode in previous version, I hope that there is a way to find a solution.
I have about 50 clients, who use OptimizePress, and I will definitely ask them to switch for the new version and purchase paid addons, if it is possible to fix.