Programmatically change post templates? [duplicate]

Try this:

while ( $query->have_posts() ) : $query->the_post();
  if ( has_tag('tag-slug') )
  {
     get_template_part( 'content', 'tag-slug' );
  }
  else
  {
     get_template_part( 'content' );
  }

endwhile;

You would then need to create content.php and content-tag-slug.php with the appropriate content.

You could also look into setting up Post Formats. A bit more work up front, but a nicer experience down the road.

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