if the post has content

The content is a property of the post object, not of the query object.

Use $post or get_post() instead:

if( '' !== get_post()->post_content ) {
// do something
}

Leave a Comment

tech