pavelk2 / social-feed

JavaScript plugin that shows a user feed from the most popular social networks
http://pavelk2.github.io/social-feed-example/
MIT License
963 stars 304 forks source link

Is there any way to add width and height to the images get from socials? #342

Open antimatterES opened 5 years ago

antimatterES commented 5 years ago

I would like to be able to add the width and height to the attachment link for each social network. That way everybody will avoid error messages from GTMetrix about missing dimensions for the images. I have tried adding new vars e.g.

var image_width = element.width; var image_heigth = element.height;

An then add the vars to the attachment with no success. e.g. for instagram

post.attachment = '<img class="attachment" src="' + element.images.standard_resolution.url + '' + '" width="' + image_width + '" height="' + image_heigth + '" />';

I have tried as well height() as a function but it doesn't work either.

Please, could you be kind to let me know how to get this done? It would be very appreciated!

Thanks in advance!

antimatterES commented 5 years ago

There is no one to answer this question? Please, it would be important for the SEO of my website.

Thanks in advance!