Add a custom class to wp_get_attachment_link
When we use function “wp_get_attachment_link” in wordpress can not add class or other attributes, to do that I have a way to create a filter function in the functions.php file, you add the code below and filefunctions.php
function add_class_attachment_link($html){
$postid = get_the_ID();
$html = str_replace('