WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Gallery Pagination (7 posts)

  1. joshrodgers
    Member
    Posted 1 year ago #

    I am using the default WordPress Gallery (along with the Cleaner Gallery plugin) to display some images. The one thing that the gallery doesn't seem to have is pagination. What I'd like to do is after 6 images add Previous and Next links to navigate through the pages.

    Having said that, there are several plugins that claim to add this capability, but all of them were developed without the new Media Library, that comes standard with WordPress 3.5. I don't want to change the experience for the user...I just want to possibly add functionality through functions.php or somehow on the loop itself. I have no problem applying the same thing to all galleries, so if the fix could somehow find the gallery short-code than that would be awesome! Not sure how to do it, just kind of thinking out loud here.

    Any help is appreciated.

    Thanks,
    Josh

  2. joshrodgers
    Member
    Posted 1 year ago #

    The code generated looks like this: http://pastebin.com/B6jW5v7m.

    Thanks,
    Josh

  3. Malvouz
    Member
    Posted 1 year ago #

    I hope I got what you mean.

    <?php if(is_attachment()): ?>
    <?php previous_image_link( false ,  __('&larr;  Previous Image', 'themes name')); ?>
    <?php next_image_link( false ,  __('Next Image &rarr;', 'themes name')); ?>
    		<?php endif; ?>

    try those code at single.php or wherever you want.

  4. joshrodgers
    Member
    Posted 1 year ago #

    Malvouz,

    Thanks for taking a stab at it...I added your code just inside the close of the WordPress loop (right before the endif) and it didn't seem to do anything, is there something else I have to do on my post to make this work?

    Thanks,
    Josh

  5. Malvouz
    Member
    Posted 1 year ago #

    It must be show "Previous Image" and "Next Image" if you using WordPress Gallery to show photos.

    1. Make a new post
    2. Add some photos and choose WordPress Gallery
    3. Link your image to attachment file.
    4. Post

    In front, click one of photos. It should be appear.

  6. joshrodgers
    Member
    Posted 1 year ago #

    Malvouz,

    That's an awesome feature, but not quite what I had in mind. What I wanted to do was:

    1. Make a new post
    2. Add some photos and choose WordPress Gallery
    3. Link your image to attachment file.
    4. Post

    Then, on the front-page, instead of displaying 50 images the gallery would display six and then add previous and/or next links at the bottom of that page - not the attachment page (paginating the main gallery page).

    Thanks,
    Josh

  7. joshrodgers
    Member
    Posted 1 year ago #

    I decided to use the NextGEN gallery instead, it takes a few extra steps to do what I want it to do...but it's not bad :)

Topic Closed

This topic has been closed to new replies.

About this Topic