I'm creating a custom attachment template in WordPress, so far so good, but I would like to show the url of the entries or articles where that image belongs
somehow?
<div class="entry-attachment">
<?php if (wp_attachment_is_image($post->id)) :
$att_image = wp_get_attachment_image_src($post->id, "full"); ?>
<p class="attachment"><a href="<?php echo wp_get_attachment_url($post->id); ?>" title="<?php the_title(); ?>" rel="attachment"><img src="<?php echo $att_image[0];?>" width="<?php echo $att_image[1];?>" height="<?php echo $att_image[2];?>" class="attachment-medium" alt="<?php echo $post->post_excerpt; ?>" /></a><figcaption class="captiont">
<?php echo wp_kses_post(get_post(get_post_thumbnail_id())->post_excerpt); // displays the image caption ?> </figcaption>
</p>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744820548a4595588.html
评论列表(0条)