Is there any way to remove the image size of the wp_get_attachment function?
I was trying the following code with no luck, trying to get it either 100% or nothing at all.
echo wp_get_attachment_image($variable, array(100 . '%', 100 . '%'));
EDIT
This is what I ended up with that works perfectly thanks to drew010.
echo '<img src="'.wp_get_attachment_url($variable).'" alt="'.get_the_title().'" />';
@Jrod has the correct answer IMO, but you can also just call
wp_get_attachment_url($variable);
which gives you the URL to the full image. Then you can simply construct your own HTML markup for displaying the image.
If you want the full size image you should use the following:
echo wp_get_attachment_image($variable, 'full');
You can't use it this way: alt="'.get_the_title().'"
You must use esc_attr($attachment->post_title)
or the_title_attribute()
.
If the title has some html tags your alt attribute can crash your html outline. Trust me, a year ago I searched for over 1 hour this bug in some theme.