Next and Previous Links in WP2.5 gallery (3 posts)

  1. Sr-ultimate
    Posted 8 years ago #

    I would like to know the code to show up the links of next and previous attachments when an individual attachment (/?attachment_id=) is shown.

    I tried the usual posts links <?php next_posts_link('&laquo; Older Entries') ?> but those are not working.

  2. dliem
    Posted 8 years ago #

    You will want to use:

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

    And example of this can be found in the default theme that comes with wordpress 2.5 in the image.php file.

    When linking to attachments in wordpress gallery, it defaults to pulling from image.php. If image.php doesn't exist it will default to single.php.

    Hope this helps.

  3. thisisshawn
    Posted 7 years ago #

    I tried this... and it worked... but I can't get it to function in IE.

    Any thoughts dliem?


Topic Closed

This topic has been closed to new replies.

About this Topic