Is it possible to print two different url’s from the same featured image/thumbnail?
So i have set up my image size..
add_image_size( 'full-size', 460, 9999 );
add_image_size('fixed-height', NULL, 75, false);
I need to pull the url of these two images sizes into the post like so..
<li><img src="full-size.jpg" ref="fixed-height.jpg" ></li>
Obviously i could not use the normal way..
<li><img src="<?php the_post_thumbnail('full-size'); ?>" ref="<?php the_post_thumbnail('fixed-height'); ?>" ></li>
Is it possible to do what i’m after, or no go?
Thanks for anyone that can help 🙂
no problem to have 2 or more post thumbnails of different sizes.
but what is the “ref” attribute ? do you mean “rel” ?
anyhow – example from the :codex
mind that
the_post_thumbnail()
will give you the full HTML for the image , to get other attributes, you will need to useget_the_post_thumbnail()
orget_post_thumbnail_id()
withwp_get_attachment_image_src
I would combine
the_post_thumbnail()
withget_intermediate_image_sizes()
, e.g.:Note: I don’t think
get_intermediate_image_sizes()
sorts the array of image sizes, so you may need to manipulate the return value, if you want to output the images ordered by size.