• Resolved joshrodgers

    (@joshrodgers)


    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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter joshrodgers

    (@joshrodgers)

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

    Thanks,
    Josh

    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.

    Thread Starter joshrodgers

    (@joshrodgers)

    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

    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.

    Thread Starter joshrodgers

    (@joshrodgers)

    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

    Thread Starter joshrodgers

    (@joshrodgers)

    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 ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Gallery Pagination’ is closed to new replies.