WordPress.org

Make WordPress Core

Ticket #5911: 5911-23.diff

File 5911-23.diff, 1.2 KB (added by andy, 6 years ago)

remove ugliness from default attachment template

  • attachment.php

     
    88                        <div class="alignleft">&nbsp;</div> 
    99                        <div class="alignright">&nbsp;</div> 
    1010                </div> 
    11 <?php $attachment_link = get_the_attachment_link($post->ID, true, array(450, 800)); // This also populates the iconsize for the next line ?> 
    12 <?php $_post = &get_post($post->ID); $classname = ($_post->iconsize[0] <= 128 ? 'small' : '') . 'attachment'; // This lets us style narrow icons specially ?> 
    1311                <div class="post" id="post-<?php the_ID(); ?>"> 
    1412                        <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> 
    1513                        <div class="entry"> 
    16                                 <p class="<?php echo $classname; ?>"><?php echo $attachment_link; ?><br /><?php echo basename($post->guid); ?></p> 
     14                                <p class="attachment"><?php echo wp_get_attachment_link(0, 'medium', false); ?></p> 
    1715 
    1816                                <?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?> 
    1917