Get posts of an specific term of a custom taxonomy

You need to use the methods of your query instance, rather than the global functions (which are merely wrappers for the global $wp_query):

if ( $query->have_posts() ) {

    $term = $query->queried_object;

    while ( $query->have_posts() ) : $query->the_post();
        //Output my posts
        the_title();
        the_content();
    endwhile;
}

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