Why is my category post repeating twice

You are calling a weird parameter in line 24 which i dont understand… did you copy paste this function from elsewhere?

anyhow…
change line 24 from:

'$param_type' => array($term->term_id),

To this:

'cat' => array($term->term_id),

Good luck and dont forget to read @toscho comment for future questions.

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