• Resolved joshuef

    (@joshuef)


    Hey Jordy, Thanks for what’s looking like a top notch plugin.

    After being a fool for a while (didn’t notice the 3.5 requirement on the latest build!), I have it up and generating the images nicely.

    I’m using a custom built theme, which is grabbing images via the wp_get_attachment_image_src( $attachment->ID, 'large' ); function. This doesn’t appear to automagically grabbing the new retina images (I’m in debug mode / server side).

    I think this is because I’m only linking to the images (where I then display larger versions in a colorbox).

    Any ideas on how to trigger retina images here? (Do you have an ‘if retina’ function or some such?) Or should I be looking to change how I pull images from posts? I’m happy to have a dig around, but I’m not really sure where to begin here. So any ideas would be super welcome.

    Here’s a full snippet of the code to generate the links:

    $a_count = '0'; // count the number of attachments
    	$attachments = get_posts( $pic_args );
    	     if ( $attachments ) {
    	        foreach ( $attachments as $attachment ) {
    			$a_count++ ; //count for number of images
    	 			$img_bits = wp_get_attachment_image_src( $attachment->ID, 'medium' );
    	 			$img_lg = wp_get_attachment_image_src( $attachment->ID, 'large' );
    
    				echo '<a href="'.$img_lg[0].'" id="' . $a_count .'"><img class="slide colorbox-' . $post->ID . '" src="' . $img_bits[0] .  '" height="100%" title="'. $attachment->post_excerpt .'"/></a>';
    
    	          } //foreaech
    	     } //if attachment	?>

    http://wordpress.org/extend/plugins/wp-retina-2x/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Actually it’s way more simple than you think. Don’t think about the retina support for your theme, it will magically work 🙂 It’s normal the wp_get_attachment_image_src will retrieve the “normal” image. It’s fine like this. But it is later, when you browse the website, that the retina images will be retrieved. Don’t worry about it at all when you work on your theme, there is no need 🙂

    Thread Starter joshuef

    (@joshuef)

    Thanks for the fast reply!

    Heh, sounds awesome, but I must be having another issue then…

    It’s generating the images, in theory, though I see no difference between them at the moment. (And, running debug mode doesn’t change anything on the site itself…)

    Here are two from a large file, that gives me the all clear for each retina image:

    http://jelka.wyli.co.uk/wp-content/uploads/2013/01/Centerbury-7-of-24-1024×678.jpg

    http://jelka.wyli.co.uk/wp-content/uploads/2013/01/Centerbury-7-of-24-1024×678@2x.jpg

    Could it be that the original isn’t large enough? (http://jelka.wyli.co.uk/wp-content/uploads/2013/01/Centerbury-7-of-24.jpg)

    Thread Starter joshuef

    (@joshuef)

    To update:

    I think there is an issue with the image generation (though no idea what). After running ‘Regenerate thumbnails’, I got suitably resized images.

    Another thing though, is that these are still not being served to the site. (jelka.wyli.co.uk ; the third, lower image is the only one high-res enough to have retina pictures).

    I’m accessing the large image size via a colorbox plugin, could this me interfering with the Retina script in some way?

    Plugin Author Jordy Meow

    (@tigroumeow)

    Sorry for the late reply, but the plugin seems to work well on your website. The photo is indeed retina at the bottom. What is the problem actually?

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Utilising in my custom theme’ is closed to new replies.