WordPress.org

Forums

NextGen Gallery - add a class to the image thumbnails (7 posts)

  1. matstillo
    Member
    Posted 6 years ago #

    Hi there,

    I'm hoping this post will be seen by Alex, the developer of this great plugin, or anyone else who can help!

    I want to use Jquery & a little script called Opacify on the NexGen Gallery thumbnails, to change the opacity on rollover. I have this working on a few other WP installs, on custom field images, but I had not tried it on my NG gallery thumbs till now.

    All I need to do is add the class "opacify" to my img tags & I should be fine. Normally I can just code this as I call the custom field, but I can't see how to do this for my NG thumbs without pulling the plugin apart, which I don't want to do, or even know where to begin.

    Anyone know how I can add this class to my thumbnail img tags as they are created?

    Thanks!

  2. Gerben van Eijk
    Member
    Posted 6 years ago #

    in the nextGEN gallery directory there's a subdirectory called "View" in there you can find a file named gallery.php
    That's the file that generates all the thumbnails for the galleries, so that's where you should be able to add the class to the image tag.

  3. matstillo
    Member
    Posted 6 years ago #

    Excellent news! Thanks very much for pointing me in the right directions!

    I'll go give it a try now

  4. matstillo
    Member
    Posted 6 years ago #

    That works fine now, thanks a million for the assistance.

    As I mentioned earlier, althoug I'm really pleased it works, I was hoping to avoid changing core files for the plugin. Now that I have, how will this affect any future plugin upgrades? I guess I will just have to make the changes again as gallery.php will be overwritten?

    I have made a note of what I have done & where, & will just have to try to remember to redo things when I ok any upgrades! What sort of systems do people have for this sort of thing?

    Thanks once again!

  5. hyperdude
    Member
    Posted 5 years ago #

    Hi matstillo, would you be so kind to show us the final solution to this, or what code you used to get this effect working. I am fairly new to Jquery and have never use this effect before.

  6. matstillo
    Member
    Posted 5 years ago #

    @hyperdude, not sure if you have solved this yet. I haven't been in the forum for a bit, shame it doesn't notify you of replies.

    Since posting this, NextGen now supports template files which you can store in your own theme folder in a folder called 'nggallery', I think. You can then duplicate gallery.php from the plugin 'view' folder & make any changes you want. The plugin will always check in your theme folder for any template files before it goes to it's own.

    It's a lovely way of doing it that I wish more plugins would use.

    With opacify, you can just pop the opacify.js script in your theme folder & call it from your header.php, along with jquery.js. You can now add class="opacify" to the image in your templates to get it to work.

    Hope this helps!

  7. hyperdude
    Member
    Posted 5 years ago #

    Thanks for the update. I don't get on the forums much lately also as I have been pretty busy.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.