Better attachment template. Hat tip: Andy. Fixes #6150.

git-svn-id: http://svn.automattic.com/wordpress/trunk@7221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2008-03-11 00:02:15 +00:00
parent 9c8a54f24a
commit b0cf57810e

View File

@ -8,12 +8,10 @@
<div class="alignleft">&nbsp;</div>
<div class="alignright">&nbsp;</div>
</div>
<?php $attachment_link = get_the_attachment_link($post->ID, true, array(450, 800)); // This also populates the iconsize for the next line ?>
<?php $_post = &get_post($post->ID); $classname = ($_post->iconsize[0] <= 128 ? 'small' : '') . 'attachment'; // This lets us style narrow icons specially ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2><a href="<?php echo get_permalink($post->post_parent); ?>" rev="attachment"><?php echo get_the_title($post->post_parent); ?></a> &raquo; <a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<div class="entry">
<p class="<?php echo $classname; ?>"><?php echo $attachment_link; ?><br /><?php echo basename($post->guid); ?></p>
<p class="attachment"><?php echo wp_get_attachment_link(0, 'medium', false); ?></p>
<?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>