Ready to get started?Download WordPress


Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/next image link


This creates a link to the next image attached to the current post. Whenever a series of images are linked to the attachment page, it will put a 'next image link' with the images when viewed in the attachment page.


Typically uses in attachment.php. In the WordPress default theme Twenty Eleven and Twenty Twelve, it is used in image.php.  <?php next_image_link$size$text ); ?> 


(string) (optional) Size of image, either array or string. 0 or none will default to post_title or $text.
Default: thumbnail
(string) (optional) If included, link will reflect $text variable.
Default: false


Default Usage

 <?php next_image_link(); ?>

Working example

 <div class="alignright"><?php next_image_link(); ?></div>

Change Log

  • Since: 2.5.0
  • 2.8 added 2 parameters: $size and $text


See also previous_image_link()

See also index of Function Reference and index of Template Tags.