Give active class to current page on a while loop WP query for custom post types listing

Assuming you want to add the class to the li element.

<li<?php echo get_queried_object_id() == get_the_ID() ? ' class="active"' : '';?>>

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