WordPress Pages “allow comments” meta option can’t be checked

Thanks to the theme developers for helping me fixing it.

I’m posting the answer here in hope that it may helpes any person facing the same problem.

In functions.php there was a code to disable comments on page.php

Remove this part of code from functions.php to make the comments working on pages too:

    function default_comments_off( $data ) {
    if( $data['post_type'] == 'page') {
    $data['comment_status'] = 0;
    }

    return $data;
    }
    add_filter( 'wp_insert_post_data', 'default_comments_off' ); 

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)