Hello,
I am using a Knowledge Base Plugin which crates a CPT hr_kb. This post is selected in the form admin area to show wpDiscuz. But it continues to show the default comment form.
I followed all suggestions in this thread: https://gvectors.com/forum/how-to-and-troubleshooting/resolved-wpdiscuz-comment-form-is-missing/paged/1/
I even placed <?php comments_template() ?> inside the CPT single template. But it still shows the default form.
Please help me on this. Since it is rather urgent I would gladly pay for your support in finding a solution directly on my site.
Best Michael
Please check the 3rd page of this topic, it seems you've not enabled comment form for this custom content type: https://gvectors.com/forum/how-to-and-troubleshooting/resolved-wpdiscuz-comment-form-is-missing/paged/2/#post-2751
Hello, as I specifically mentioned this has been done 😉
This post is selected in the form admin area to show wpDiscuz. But it continues to show the default comment form.
If you could enable private feedback I would gladly give you access to check this on site.
Michael
Hi again, I was in the meantime able to resolve this. The problem was with the Knowledgeable plugin.
thx though
Thank you for letting us know.
Hi again, I was in the meantime able to resolve this. The problem was with the Knowledgeable plugin.
thx though
hey Michael, if you can, do you mind letting me know what the issue was?
I'm having the exact same problem (default comment form shows only on specific post type, even though post type is checked/form is re-saved) with plugin WP-Filebase.
In a desperate attempt for an answer, I'm going to click "Reply" under your comment in case that notifies you of a new reply lol. See comment above.
Hi FTLRalph,
Are you sure this content type supports comments? Please deactivate wpDiscuz and check it the default comment form appears on this custom content type pages.
Hi Ralph,
yes that worked 😉 Did not see your first reply.
The first time I got it to work I just manually placed this inside the template file where I wanted the comments to appear. <?php comments_template() ?>
The following is the explanation and hopefully better solution provided by https://www.dev4press.com another Knowledge Base plugin I switched to in the meantime. ( I have not yet tried this)
"The reason why the WPDiscuz doesn't work with my plugin compatibility mode is on the WPDiscuz side, and will not work with any other plugin using similar technique (bbPress, BuddyPress, WooCommerce...). This plugin checks for the replacement of the comment form when page is starting to load on wp_head action. If this action is replaced with earlier action: wp (that runs before template is loaded), plugin works with my plugin and with any theme using my plugin:
Let me know if that works for you!
Hey michael thanks for that. I really thought that would be it but unfortunately nothing seems to have changed. It could be the solution for your problem, even though mine is similar it is a different plugin (WP Filebase).
In one last desperate attempt at a quick fix, when you mention <?php comments_template() ?>, do you mean you manually placed that inside a plugin file - a Knowledgebase file or WwpDiscuz file?
As it stands it seems my plugin here utilizes the themes Single.php file to render these custom posts, and that Single.php file already uses <?php comments_template() ?> to show comments, so not sure if this is even relevant for me.
Thanks anyway though appreciate the help.
Hi FTLRalph,
Are you sure this content type supports comments? Please deactivate wpDiscuz and check it the default comment form appears on this custom content type pages.
Hi, it does. It displays the default comment form before/after enabling wpDiscuz even though I have the wpfb_filepage post type checked in "Forms" and have verified this plugin uses Single.php in the theme, which uses <?php comments_template() ?> as well.
wpdiscuz plugin => file 'class.WpdiscuzCore.php', line 62 replace:
add_action('wp_head', array(&$this, 'initCurrentPostType'));
with
add_action('wp', array(&$this, 'initCurrentPostType')); "
Let me know if that works for you!
Ok, thank you, we'll take this under consideration.
wpdiscuz plugin => file 'class.WpdiscuzCore.php', line 62 replace:
add_action('wp_head', array(&$this, 'initCurrentPostType'));
with
add_action('wp', array(&$this, 'initCurrentPostType')); "
Let me know if that works for you!Ok, thank you, we'll take this under consideration.
Hi Tom, sorry to be annoying but would you have any ideas what could be causing this or what to look at? I'd contact the WP-Filebase dev but he's missing in action (see opening post). Thanks.
For what it's worth, I was able to get it working by changing this line in class.WpdiscuzHelper.php:
return $form->getFormID() && (comments_open($post) || $post->comment_count) && is_singular() && post_type_supports($post->post_type, 'comments');
And removing the last bit: post_type_supports($post->post_type, 'comments');
For whatever reason, even though the wpfb_filepage post type is registered like this...
register_post_type('wpfb_filepage', array(
'labels' => array(
'name' => __('Files', 'wp-filebase'),
'singular_name' => __('File', 'wp-filebase')
),
'label' => __('Files', 'wp-filebase'),
'show_ui' => true,
'show_in_menu' => false,
'show_in_nav_menus' => true,
'public' => true,
'has_archive' => false,
'rewrite' => array('slug' => WPFB_Core::$settings->file_page_url_slug, 'with_front' => WPFB_Core::$settings->file_page_url_wfront), //WPFB_Core::$settings->file_post_type_slug),
'supports' => array(
'comments' => WPFB_Core::$settings->file_page_comments,
'title' => true, // displayed when editing
'editor' => true,
...
...with WPFB_Core::$settings->file_page_comments being TRUE, this one check always produced false? I'd like to check what the value of "supports comments" is in the database for this post type, but I don't know where to look.
I figured if comments_open() is true that's good enough of a check for me here.
As far as I see your new post type doesn't support comments. Instead of this change it would be better to add a small code in functions.php of your active theme to enable comments for this post type. This kind of code may be found in internet or you could ask a support question to the post type creator plugin support team.
Hi,
your plugin has definitely an issue with custom post types. As it works on my default posts but not on a custom post type set up with plugin "Custom Post Type UI" ( https://de.wordpress.org/plugins/custom-post-type-ui/) and configured to support comments, just the default comments form appears on that custom post type pages. I walked through all the tips in this thread and https://wpdiscuz.com/docs/wpdiscuz-documentation/getting-started/missing-comment-form/ without success.
Then I went deep into the code. The issue is related to the variables $formPostRel and $formContentTypeRel in class wpDiscuzForm. The first one just contains post, page and attachment. The second contained nothing, so function "getForm" of the same class is not able to determine the $formID for my custom post type and returns 0. This causes a chain reaction: the frontend stuff can not be loaded, your plugin "thinks" it is not initialized and does not overwrite the template file in WP internal function "comments_template" at apply_filters( 'comments_template', $theme_template).
I found out that the mentioned variable $formContentTypeRel which should contain my custom post type gets populated by class WpdiscuzOptionsSerialized from serialized options stored in wp_options table as "wpdiscuz_form_content_type_rel". As I did not figure out how this value can be changed via your plugin's admin panel, I manually added my custom post type to the serialized string and now it works (the default wpdiscuz form ID can be determined).
Could you please check this behavior? Because I am afraid that the serialized options value will be overwritten again by your plugin and my custom post type will be removed again.
Hi @timo,
you just need to navigate to Dashboard > Comments > Forms, edit the Default Form make sure it's enabled for all post types, save it then do Ctrl+F5 on front-end.
Check Tip1 in this support topic:
https://gvectors.com/forum/how-to-and-troubleshooting/resolved-wpdiscuz-comment-form-is-missing/
Wow, thanks! Why is this not documented on the above mentioned documentation page? I didn't plan on having to search the forum.
Thanks, I must have overseen this. I was just checking the options sections of your plugin and did not recognize the subsection "Forms". Maybe you can place a special hint regarding custom post types in the options section.