White screen when posting comment on custom post type (11 posts)

  1. qbert423
    Posted 4 years ago #

    My WordPress site has regular posts and a few other custom post types. Comments are working with no problems on the regular posts, but when it comes to commenting on a custom post type, all I'm getting is a blank screen (wp-comments-post.php) as soon as I click the 'Leave Comment' button.

    I've tried turning on debugging in wp-config.php, but I'm getting no errors returned. I've also tried switching off Akismet, but doing so doesn't solve the problem.

    Is commenting possible on custom post types? Anybody have any ideas?

    Many thanks

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    Yeah, commenting works fine in all my CPTs.

    Do you have comments in the supports line?

    'supports' => array( 'title', 'editor', 'comments', 'excerpt', 'custom-fields', 'thumbnail', 'revisions' ),

    I'm not sure exactly if/how this affects it, but it's the first thing I would look at

  3. qbert423
    Posted 4 years ago #

    Yep, I already have that in there.

  4. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    How does the URL look when hovering over the Submit button in relation to the actual URL of the post?

    If anything is malformed, try a permalink flush. (Just go to permalinks and hit save)

  5. qbert423
    Posted 4 years ago #

    The destination URL cannot be seen when I hover over the button - this works for standard links, but not buttons.

    I tried a permalink flush, but no joy there.

    Looking at the source, the form is exactly the same as the one that works on standard posts...

  6. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    Hmmm... any plugins active?

    Were pretty much running down the standard troubleshooting here. I had to do this recently, it's kind of a pain.

    Try all plugins inactive, that's the easy part.

    After that, to test if its specifically theme related you can make a child theme to twentyten and test on twentyten

    --child theme really just needs a style.css with the basic header and import rule to pull in twentyten style, a functions.php registering your custom post type, and whatever tenplate you are using to call your CPTs

    (The child theme thing is a PITA, but once you set one up, you can use it to troubleshoot things in the future, as it's impossible to test things like CPTs, or custom functions by just 'switching to twentyten theme')

  7. qbert423
    Posted 4 years ago #

    I'll give what you suggest a shot and let you know how I get on. Thanks for your help

  8. quacky
    Posted 4 years ago #


    I have the same issue on comments with custom post type.

    when a user leaves a comment, you get a white page on wp-comments-post.php

    The comment appears in your dashboard, but when you approve it, this comment does not keep the approved state.

    The only way I found so far, is to change in the database the comment approved state to '1' but that does not solve the white page after a user leaving a comment !

    Plugins I use: Xml sitemap, PHP exec, All In One Seo, WP-Polls.

    Ideas are welcomed !

  9. qbert423
    Posted 4 years ago #

    Well you've got 1 step further than me... the comments aren't even posted on my setup. I just get the white screen! I need to try disabling plugins etc., but if anyone has any further ideas...

  10. quacky
    Posted 4 years ago #

    Ok I found a solution to the issue.

    In wp-includes\pluggable.php you comment the 2 lines 282 & 283
    //require_once ABSPATH . WPINC . '/class-phpmailer.php';
    //require_once ABSPATH . WPINC . '/class-smtp.php';

    It seems the path to the files are not correct and these files are already included anyway

    Try it and let me know

  11. qbert423
    Posted 4 years ago #

    Sorry quacky, that didn't do it... still getting the white screen when I submit the post...

Topic Closed

This topic has been closed to new replies.

About this Topic