Title: next_image_link
Published: April 25, 2014
Last modified: May 20, 2026

---

# next_image_link( string|int[] $size = 'thumbnail', string|false $text = false )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/next_image_link/?output_format=md#parameters)
 * [More Information](https://developer.wordpress.org/reference/functions/next_image_link/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/functions/next_image_link/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/next_image_link/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/next_image_link/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/next_image_link/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/next_image_link/?output_format=md#wp--skip-link--target)

Displays next image link that has the same post parent.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/next_image_link/?output_format=md#parameters)󠁿

 `$size`string|int[]optional

Image size. Accepts any registered image size name, or an array of width and height
values in pixels (in that order). Default `'thumbnail'`.

Default:`'thumbnail'`

`$text`string|falseoptional

Link text.

Default:`false`

## 󠀁[More Information](https://developer.wordpress.org/reference/functions/next_image_link/?output_format=md#more-information)󠁿

 * 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 );
       ```
   

## 󠀁[Source](https://developer.wordpress.org/reference/functions/next_image_link/?output_format=md#source)󠁿

    ```php
    function next_image_link( $size = 'thumbnail', $text = false ) {
    	echo get_next_image_link( $size, $text );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/media.php#L3921)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/media.php#L3921-L3923)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/next_image_link/?output_format=md#related)󠁿

| Uses | Description | 
| [get_next_image_link()](https://developer.wordpress.org/reference/functions/get_next_image_link/)`wp-includes/media.php` |

Gets the next image link that has the same post parent.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/next_image_link/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/next_image_link/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/next_image_link/?output_format=md#comment-content-1270)
 2.   [Codex](https://profiles.wordpress.org/codex/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/next_image_link/#comment-1270)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fnext_image_link%2F%23comment-1270)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fnext_image_link%2F%23comment-1270)
 4. **Basic Example**
 5.     ```php
        <div class="alignright"><?php next_image_link(); ?></div>
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fnext_image_link%2F%3Freplytocom%3D1270%23feedback-editor-1270)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fnext_image_link%2F)
before being able to contribute a note or feedback.