alt, title tags not showing

0
53

add titlw tag to alt tags automatic add this code in themes function file
function isa_add_img_title( $attr, $attachment = null ) {

$img_title = trim( strip_tags( $attachment->post_title ) );

$attr['title'] = $img_title;
$attr['alt'] = $img_title;

return $attr;
}
add_filter( 'wp_get_attachment_image_attributes','isa_add_img_title', 10, 2 );

LEAVE A REPLY

Please enter your comment!
Please enter your name here