Limit "gallery post format" number of images displayed
Support Area › Forums › Photobug › Limit "gallery post format" number of images displayed
- This topic has 12 replies, 3 voices, and was last updated 11 years, 2 months ago by Bill Robbins.
-
AuthorPosts
-
October 4, 2012 at 11:01 #7781karim hadidParticipant
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,
KarimOctober 4, 2012 at 11:43 #7782Bill RobbinsModeratorKarim,
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:
- Go to the appearance section and select edit to open up the theme editor.
- From the list of files on your right, choose gallery-layout.php
- Replace the code on that page with this:
- 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,
BillOctober 4, 2012 at 12:57 #7783karim hadidParticipantThanks 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)October 4, 2012 at 14:37 #7788Bill RobbinsModeratorNow that is unusual. Any chance you can send a link so I can take a closer look at the comments for you?
October 4, 2012 at 21:52 #7791karim hadidParticipantHere you go: http://goo.gl/GeJQ3
October 4, 2012 at 22:12 #7792Bill RobbinsModeratorThanks 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,
BillOctober 8, 2012 at 08:48 #7802karim hadidParticipantThanks 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.
October 8, 2012 at 10:37 #7806Bill RobbinsModeratorYou 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,
BillOctober 9, 2012 at 04:58 #7812karim hadidParticipantThanks so much! 🙂
January 28, 2013 at 12:39 #9152Joel CornettParticipantI 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”January 28, 2013 at 14:27 #9163Bill RobbinsModeratorJoel,
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:
January 28, 2013 at 14:30 #9164Joel CornettParticipantnope, still not working… here is the link to an example.. there are somewhere around 55 pictures, I only want 16 on the home page…
January 28, 2013 at 14:51 #9167Bill RobbinsModeratorJoel, any chance you could email a login to support@organizedthemes.com?
-
AuthorPosts
- The topic ‘Limit "gallery post format" number of images displayed’ is closed to new replies.