Home / Archive / Add a custom alt text for Instagram Feed images
Duplicate Snippet

Embed Snippet on Your Site

Add a custom alt text for Instagram Feed images

By default, the alt text for Instagram Feed images is the feed caption. You can add any custom alt text to the image by changing the alt text in the below snippet.

Code Preview
php
<?php
function sbi_img_alt( $img_alt, $post ) {
	$alt_text = __( 'Instagram Image', 'instagram-feed' );
	return $alt_text;
}
add_filter( 'sbi_img_alt', 'sbi_img_alt', 10, 2 );

Comments

Add a Comment