[wp-trac] [WordPress Trac] #14296: Don't show previous post link on orphaned attachments

WordPress Trac wp-trac at lists.automattic.com
Wed Jul 14 04:43:33 UTC 2010


#14296: Don't show previous post link on orphaned attachments
--------------------------+-------------------------------------------------
 Reporter:  zeo           |       Owner:                 
     Type:  defect (bug)  |      Status:  new            
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  3.0            
 Severity:  normal        |    Keywords:  has-patch      
--------------------------+-------------------------------------------------

Comment(by zeo):

 Test case.

 For "back to parent" navigation, in theme template attachments.php or
 image.php, use:

 {{{
 <?php previous_post_link(); ?>
 }}}

 instead of the usual:

 {{{
 <a href="<?php echo get_permalink($post->post_parent); ?>"
 rev="attachment"><?php echo get_the_title($post->post_parent); ?></a>
 }}}

 or

 {{{
 if (!empty($post->post_parent))
 ...
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14296#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list