Limit "gallery post format" number of images displayed

Support Area Forums Photobug Limit "gallery post format" number of images displayed

Viewing 13 posts - 1 through 13 (of 13 total)
URL to the page in question:
  • Author
    Posts
  • #7781
    karim hadid
    Participant

    Hi Bill,

    I have 2 quick questions for you:
    – in the Gallery Post Format, is there a way to limit the number of images displayed on the blog main page (not in the single post view though). Some of my posts will have a lot of images and the gallery would be too long on the home page. Does it make sense?
    – do you have news regarding the captions in the gallery?

    Thanks so much for your help.

    Cheers,
    Karim

    #7782
    Bill Robbins
    Moderator

    Karim,

    I’ve experimented with the captions and so far I haven’t come up with a good way to display them below the thumbnails themselves. The images are so small, the text looks out of place if it has more than 3 words or so.

    But yesterday afternoon, I did come up with a way to add a caption in the lightbox view. There’s more room too so you can have a longer caption. Here’s how to do that:

    1. Go to the appearance section and select edit to open up the theme editor.
    2. From the list of files on your right, choose gallery-layout.php
    3. Replace the code on that page with this:

    4. Save your changes.

    That will add captions to the lightbox in the archive view. If you’d like to add captions for the portfolio view, you’ll need to edit gallery-portfolio.php and replace it’s content with the code at https://gist.github.com/3834840. If you want to add captions to the single view too, you’ll need to edit gallery-full.php and replace it’s content with the code at https://gist.github.com/3834847.


    You can also modify that code above to limit the number of images that are displayed on the archive page. If you’ll look in the code above for where it says this:

    
    'posts_per_page' => '-1',
    

    you can change the -1 (which displays all images) to the maximum number you’d like to include in the archive page galleries. Save your changes when you’re finished and that should take care of it for you.


    If you have any questions or trouble, let me know,
    Bill

    #7783
    karim hadid
    Participant

    Thanks for the fast response. I was especially looking for captions in the single post view so that should do the trick. ! I’ll have a play and let you know if I get stuck on anything.

    Sorry to post that here but I just ran into something weird on the comments. It displays the following right under the persons name in the single page view. I’m guessing these are the variables for the date and time of the comments but not the content of those variables. Any idea what can cause this?
    %A %e %B %Y at %H:%M (Edit)

    #7788
    Bill Robbins
    Moderator

    Now that is unusual. Any chance you can send a link so I can take a closer look at the comments for you?

    #7791
    karim hadid
    Participant

    Here you go: http://goo.gl/GeJQ3

    #7792
    Bill Robbins
    Moderator

    Thanks for sending the link. I took a look and it seems like it may be a translation error. Here’s the line in the .po file that goes with the comment date/time:

    
    #. Text in function
    #: photobug/includes/comment-functions.php:47
    msgid "%1$s at %2$s"
    msgstr ""
    

    I’d check that section of your language file and make sure that it’s set right.

    If I can help, let me know,
    Bill

    #7802
    karim hadid
    Participant

    Thanks mate, the caption tweak works great for all the lightboxes.

    In the single view, is there a way to also display those captions right under each image so that people don’t have to open the lightboxes to see the captions?

    I’ll look into the translation issue as well, but this seems to occur in english as well. Will let you know how I go.

    Thanks again for your help Bill. You’re a legend.

    #7806
    Bill Robbins
    Moderator

    You can display the captions in the single view, right below the images. In the theme editor, replace the content in gallery-full.php with this:

    Save your changes and that will add in the captions for you.

    Enjoy your week,
    Bill

    #7812
    karim hadid
    Participant

    Thanks so much! 🙂

    #9152
    Joel Cornett
    Participant

    I am trying to limit the number of pictures on my home page to 16, but show more in the full view, so I found this thread, and followed what you said.

    I got only 16 to show on the home page, but those same 16 are the only ones that show on the full page too…

    gallery-layout.php (found in the “includes” folder) has 16 where it says “posts per page”
    gallery-full.php (found in the same folder) has -1 where it says “posts per page”

    #9163
    Bill Robbins
    Moderator

    Joel,

    I haven’t tried that previously, but that sounded like the right code to edit. I ran a quick experiment on my development site and it worked that way with 3 (I don’t have a post with more than 9 set up).

    Here’s the code that I used for the gallery-layout.php file:

    #9164
    Joel Cornett
    Participant

    nope, still not working… here is the link to an example.. there are somewhere around 55 pictures, I only want 16 on the home page…

    #9167
    Bill Robbins
    Moderator

    Joel, any chance you could email a login to support@organizedthemes.com?

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Limit "gallery post format" number of images displayed’ is closed to new replies.