How do you get attached image custom url.
-
How do you query this link to url from image attributes.
Image:
Image<?php $images = get_children( array( 'post_parent' => 13123, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'rand', 'numberposts' => -1 ) ); /* $images is now a object that contains all images (related to post id 1) and their information ordered like the gallery interface. */ if ( $images ) { //looping through the images foreach ( $images as $attachment_id => $attachment ) { ?> <?php /* Outputs the image like this: <img src="" alt="" title="" width="" height="" /> */ ?> <?php echo wp_get_attachment_link($attachment_id); ?> <?php echo wp_get_attachment_image( $attachment_id, 'full' ); ?></a> This is the Caption:<br/> <?php echo $attachment->post_excerpt; ?> This is the Description:<br/> <?php echo $attachment->post_title; ?> <?php } } ?>
Im using this query..
- The topic ‘How do you get attached image custom url.’ is closed to new replies.