CPT Archive pre_get_posts not working?

&& is_post_type_archive('local-attractions')

is_post_type_archive isn’t set yet, WP is still deciding this, hence the call to pre
_get_posts
. Instead use:

&& $query->is_post_type_archive('local-attractions')

The same is true of any other is_ type methods, use the $query object, else you might be asking these questions about a completely different query and getting confusing results

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