pre_get_posts gives 404 error on Custom Post

This might be a quick fix for your custom post type 404 error page.

Navigate to Settings > Permalinks, and then click the Save Changes button.

Then comeback to check if the links doesn’t give you a 404 error.

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