I use NextGen Gallery for WordPress often, I think it’s a fairly solid solution with a few quirks that I can work around.
Today I’m working on a multilevel gallery for a local architect. I have a number of galleries within each album, and I wanted to show the album name and gallery name for each of them to help the visitor keep track of where they are in the stack.
To do this, go into /wp-content/plugins/nextgen-gallery/view/ and open gallery.php.
Add this line to the very top of the page:
1 |
<?php $album = nggdb::find_album( get_query_var('album') ); ?> |
Then, scroll down to about line 72 and just before the thumbnails section comment, add this:
1 |
<h2><?php echo $album->name?>: <?php echo $gallery->title?></h2> |
This will give you a nice-looking, dynamic headline like:
Thanks. I like NextGEN very much 🙂
Just in case anybody else runs across this, I struggled with getting the same thing to happen with the album-extend.php file. I’m new to php, so it may seem simple, but I got it to work by skipping the first line since it looks like $album is already called in this file. I only needed to put the second line in after . Hope this saves somebody time.
Yeah, so I’m new at posting code like this in forums too. I put it after div class=”ngg-albumoverview” tag.
Hi! thanks for your tip, works great. I have a question and I’m wondering if you can help me with that. I’m trying to implement this http://www.webdesignerwall.com/demo/decorative-gallery/1b_mini-icons.html in my wordpress site with nextgen gallery. I need to use 3 different icons for 3 different ngg TAGS. I really don’t know how to do it, I’ve been trying but it doesn’t work. I really don’t know php or codex. Thanks for any help.
Hi Claudio,
I don’t know how to do that either. You can follow these instructions and post to the WordPress forums, that’s what I’d need to do to. http://alexrabe.de/forums/
ok I will, thanks for answer!
Thanks, Chris
Thanks so much for this, been wondering how to get titles in. Cheers
What would all of us do without the magnificent concepts you share on this blog? Who else has the perseverance to deal with important topics just for common subscribers like me? I actually and my friends are very delighted to have your site among the kinds we usually visit. We hope you know how significantly we get pleasure from your work! Best wishes coming from us all.
Thank you 🙂
Great one! Any idea how to squeeze in a permalink to get users back to the landing page of the album (dynamically)?
Not off the top of my head, sorry. I haven’t had a NextGen gallery with albums in a while so haven’t come back to this lately.
Maybe this post has something to help you – see the permalinks discussion about halfway down.
http://www.vuthy.com/blog/2008/11/23/guide-to-nextgen-gallery-plugin-album-and-gallery/
Invaluble tip, thank you. I combined it with something I read about how to determine whether we’re looking at an album or gallery. This will check if we are on a gallery level and insert the titles:
if (!empty ($gallery)){
name?>: title?>
}
My markup didn’t work in my last post, but basically, the $gallery variable seems available for us to check if we’re on a gallery level.
Just a tipp: It’s better to override the nggallery templates in your own template folder. otherwise you’ll loose your modifications after an update of the plugin. An example how you can override the nggallery templates, you can find here: http://mygraphicfriend.wordpress.com/2010/01/11/custom-style-sheet-and-templates-for-nextgen-gallery-with-special-instructions-for-child-themes/
That’s a good point, all style changes to NGG should be done in your own theme folder, not in NGG plugin files.