How to Remove width and height attributes in wp_get_attachment_image
“wp_get_attachment_image” function here is to take pictures in the page or post, what do I use this slider for the home page from the home page, it’s height and width attribute network, but in some cases we do not need it because it affects the size of the image.
Example: when the logo must partner often limited by size image max-width max-height, but that is because the width and height values, it’s the rate of loss.
When I stand before jquery to remove these values, but after I used this much simpler way is to use the filter function in php.
I use the function “wp_get_attachment_image” nhuu follows:
$portimg = wp_get_attachment_image( $post->ID, 'full' );
echo preg_replace('#(width|height)="\d+"#','',$portimg);
Wish you success