I am having some issue removing the width and height from my attachment images when using wp_get_attachment_image. This is what I am using to display the image
<?php echo $image = wp_get_attachment_image( $entry['slide_image_id'], true, 'full'); ?>
How it looks the the source code
<img width="150" height="108" src="http://website:8888/wp-content/uploads/2015/12/cupcakes-and-cosmetics-logo.png" class="attachment-1 size-1" alt="cupcakes-and-cosmetics-logo" />
I would like it to display like this
<img src="http://website:8888/wp-content/uploads/2015/12/cupcakes-and-cosmetics-logo.png" class="attachment-1 size-1" alt="cupcakes-and-cosmetics-logo" />
The image is getting pulled from an repeatable file field with an entry with an id of slide_image_id. I am have been looking around and have notice to use wp_get_attachment_image_url but when I use it with my above code the image does not display. Is there something I am doing wrong?
<?php echo $image = wp_get_attachment_image_url( $entry['slide_image_id'], true, 'full'); ?>
Side note: $entry['slide_image_id'] is what is being used to call my repeatable file field.
wp_get_attachment_image_url()
returns a URL - not an image element. – bosco Jan 6 '16 at 20:27add_filter('wp_get_attachment_image_attributes' ...
except only height and width are hard coded. – squarecandy Dec 2 '18 at 3:10