in attachment page .. I need to showing all images with diffrent size wordpress
How are you?
I have page attachment.php and I want to display the attachment but with all several sizes of images .
for example: cat.jpg and this image have several sizes (cat-180X180.jpg , cat-20X20.jpg , cat-60X60.jpg , cat.jpg).
when I go to (http://mysite.com/?attachment_id=771) the page shwoing the attachment with all sizes of it.
I wis开发者_如何学Pythonh you are understand me because my language is poooor ..
I think I understand, in your attachement.php file, you can just use wp_get_attachment_image_src() to bring back all the differnet sizes:
<?php $size_one = wp_get_attachment_image_src( $attachment_id, 'size_one' );
$size_two = wp_get_attachment_image_src( $attachment_id, 'size_two' );
$size_three = wp_get_attachment_image_src( $attachment_id, 'size_three' ); ?>
This assumes that you have used add_image_size() to add your image sizes?
http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src http://codex.wordpress.org/Function_Reference/add_image_size
精彩评论