0

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

  • 4
    Who are you talking too? Please format your questions and read the wordpress.stackexchange.com/help – Wyck Oct 29 '13 at 17:37
  • Please check the post and more or less it seems you have put a new questions whereas you wanted to reply in an other thread :) – Maruti Mohanty Oct 29 '13 at 18:03
  • possible duplicate of Make WordPress size and name images for Retina.js – brasofilo Oct 29 '13 at 18:37
  • @MarutiMohanty, new users can only comment in other people's Q or A's after 50rep. John, ask a Question when you have a problem with code you are writing. The answer is in the first sentence you quoted: "add the following code in your templates", theme templates that is (the one that is appropriate for you). – brasofilo Oct 29 '13 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.