why code javascript ,not repeat the loop main wordpress

I think you used #id to set javascript action (event). Use .class in jQuery selector. Open console in your browser and see javascript errors.

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