Support » Plugin: File Gallery » [Plugin: File Gallery] Pagination fix

  • When activating pagination [1.7-RC2] there was a bug and what it seems some debugging code displaying as negative pages (-2,-1,0) which were breaking the script when clicked.

    file-gallery\includes\templating.php ~li 872:

    // left side
    //// [alx359]
    if( 0 < $current )
    //if( 1 < $current )

    And again: ~li 907:

    //// [alx359]
    		// leftovers
    		while( 1 < $limit )
    			array_unshift($out, str_replace('<a ', '<a class="page"', _wp_link_page($c)) . $c . '</a>');

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Aesqe


    @alx359: thank you for all your fixes and bug reports, they help a lot! 🙂

    For this bug, the fix is simple – on line 902 in templating.php, instead of this:

    while( 1 < $limit )

    there should be:

    while( 1 < $limit && 0 < $c )

    I’m swamped with other work and can’t tell when 1.7 is coming out, but as WP 3.2 is here and there are some “real” bugs that need to be fixed, I hope to get to it within next few days.

    Thanks again!

    Hi Aesque,

    Glad to be of help. Can confirm that your fix works, and looks better :-).

    Great news 1.7 final is coming so soon!

    amazing plugin. exactly what i’ve been looking for and thank you so much.

    maybe i missed it somewhere, but how do i turn on pagination? i am linking to “attachment page” and on the attachment page, i would like to have pagination. this means that there is a next and previous links, correct?

    also, i have my settings to show full size image on the attachment page, but it is showing a smaller image instead.

    is there information somewhere on customizing the “attachment page”?

    thank you again!

    also, i have 12 images total in my gallery, so i set my “limit” variable to 12. this did insert pagination to true and limit to 12, but on my attachment page, there is still no pagination. maybe i need to do the code fix above? here is my tag:

    [gallery size="medium" limit="12" paginate="true" order="ASC" orderby="menu_order"]

    would still love to know how to include “full” size image on the attachment page. i have this set in my media settings, but it is still liking to the medium image.

    would also love more info on customizing the attachment page – previous, next links, centering image, etc.

    thank you again!

    more info – i looked for:

    while( 1 < $limit )

    in the file-gallery/includes/templating.php file and it is not there. maybe this fix has already been included in my current version

    Plugin Author Aesqe



    i am linking to “attachment page” and on the attachment page, i would like to have pagination. this means that there is a next and previous links, correct?

    Actually no 🙂 Pagination is for gallery content only.

    File Gallery has nothing to do with single attachment pages, but your theme does. So if you want to have previous / next attachment links, you would have to edit the “attachment.php” file in your theme’s directory.

    Hope this helps 🙂

    Plugin Author Aesqe


    also, to answer your last question, 1.6.X versions of the plugin do not have the pagination bug because they use a different pagination function 🙂

    @Aesque you are so so helpful! thank you so much for your quick responses.

    i created a “file gallery” plus floatbox and it works perfectly i tried lightbox, fancybox, thickbox and colorbox, but floatbox worked so well and was so easy to implement. it’s also fully customizable.

    my question is, is there a way to combine floatbox with an attachment page? for example, i would like to show all of my thumbnails on my post using file gallery, when a user clicks on a thumbnail, it starts my floatbox slideshow, but I’d love to show an attachment page in the floatbox window so i can include the image and other html.

    is there an easy way to do this?

    thanks again for everything! you are so helpful and your plugin is amazing!


    I have a page with the following gallery code

    [gallery size="gallery-thumbnail" link="file" limit="9" paginate="true" orderby="rand"]

    I have 22 images attached to the page indicated by the file-gallery plugin

    I have set the limit to 9 and paginate to true but have no next/previous option. Am I missing something or does paginate only work on post galleries?

    Would love to get this working on pages if anyone can point me in the right direction it would be very much appreciated.

    WordPress Version 3.2.1

    Plugin Author Aesqe


    @workpressed: it should work all the same regardless of the post type.

    Which version of the plugin are you using?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: File Gallery] Pagination fix’ is closed to new replies.