Query function not executed between element [closed]

The requires are just echoing the content, you need to put ob_start(); before the if ($query->have_posts()) :, and return ob_get_clean(); after the endif;.

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