Utilising in my custom theme
-
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 ?>
The topic ‘Utilising in my custom theme’ is closed to new replies.