How to exclude a certain CPT from a snippet for Dashboard box?

I believe just one small edit to your code would get what you want. See if this works, just change the one if() statement to the following:

if ( current_user_can( 'edit_posts' ) && $post_type !== 'avia_framework_post' )

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