alt=”<?php the_title(); ?>” not working
-
Hey all,
I have a template that displays an image attached to post. As part of the template I have the following code –
$img = $post_images->first($post->ID)->url; <!-- Photo --> <div class="content_photo"> <? if(!empty($img)){ ?><img src="<?=$img?>" width="166" height="" alt="<?php the_title(); ?>" title="<?php the_title(); ?>"/><? } ?>
</div>
However, as the media uploader assigns Alt text to the image, the ‘alt=’ portion is being ignored. Is there anyway to change this, as changing the properties of all images would be a nightmare plus it would make it a lot easier when uploading future images.
Thanks.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘alt=”<?php the_title(); ?>” not working’ is closed to new replies.