• Here is my error message.(wordpress version is 5.4.2)
    PHP Notice: Trying to get property’comment_status’ of non-object in public_html/wp-includes/comment-template.php on line 1243

    This is the source code.

    function comments_open( $post_id = null ) {
    
    $_post = get_post( $post_id );
    
    $post_id = $_post ? $_post->ID : 0;
    $open    = ( 'open' == $_post->comment_status );  // line 1243

    There is only one error occurring, no other errors.
    How can I fix this?

    • This topic was modified 4 years, 6 months ago by blackdeth73.
    • This topic was modified 4 years, 6 months ago by blackdeth73.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Trying to get property ‘comment_status’ of non-objec’ is closed to new replies.