posts archive page – closing WP_Query loop correctly [closed]

delete the following line of code

if ( ( $posts->current_post + 1 ) === $posts->post_count )
        echo '</li>';

leaving only the following portion

 <?php
        
    $last_year = $year;

    endwhile;

?>

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