Retina for Wordpress Posts

I was checking one of the answers here, and it says:

Just create the copies of images with double size using wordpress native media settings. And then add the following code in your templates.

?php $normal = wp_get_attachment_image_src( get_post_thumbnail_id( $post-ID ), 'thumbnail');
$retina = wp_get_attachment_image_src( get_post_thumbnail_id( $post-ID ), 'medium' ); ?

img src="?php echo $normal[0]; ?" data-at2x="?php echo $retina[0]; ? alt="?php the_title(); ?" width="xxx" height="xxx"/

Here my thumbnail (normal) size is 300x300px and medium thumbnail (retina) has 600x600px size. And also don't forget to load retina.js otherwise data-at2x= will not work. Good luck!"

--

I'm using the Genesis Framework, and I'm wondering where you'd suggest adding the above code

Topic retina genesis-theme-framework posts Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.