Trying to get property ‘comment_status’ of non-objec
-
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 1243This 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?
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.