Cant display custom post type posts from a specific category WordPress

It looks to me like you are using strings when they should be int.

'posts_per_page' => '20', // '20' is a string
'cat'            => '508' // '508' is a string

Should be

'posts_per_page' => 20,  // 20 is int
'cat'            => 508  // 508 is int

I think this is probably the main issue.

Also we would need to see if your custom post type uses the default categories. If not ‘cat’ will not work and you may need to use ‘tax_query’ in place of ‘cat’.

Hope this helps good luck.

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