NextGEN Gallery
How do I use different css stylesheets for differnt galleries? (4 posts)

  1. comatosed
    Posted 4 years ago #

    I've been trying for about three hours now. All I want to do is have gallery A use one kind of sylesheet and gallery B use another. I think it's possible and I'm just missing something. This tutorial was the closest I got:


    but all my galleries are effected when I change the css file. There must be a way to call a specific style sheet in the gallery.php file, then I could make multiple gallery.php files and use the shortcode [ nggallery id=1 template=yourtemplatename ] for various galleries.

    I'm not that great with php or css so please walk me through it if you could. Thanks,



  2. InHouse
    Posted 4 years ago #

    Greg, did you ever figure this out? You don't have to get tricky, you can just target different galleries specifically using CSS. Each gallery has its own id so if you want to make images in gallery A look different than B you would need to target the specific gallery. Hope this helps. Let me know if you need more help.

    For example:

    #ngg-gallery-1-586 .ngg-gallery-thumbnail {
    #ngg-gallery-2-245 .ngg-gallery-thumbnail {
  3. comatosed
    Posted 4 years ago #

    Sorry, I've just been dealing with the problem. Today I wanted to fix it again, googled it, and found my own post! Thanks for the reply. So would I add this CSS to the nggallery.css files then?

    A little more info: I want the image thumbnails on my blog to be centered and the thumbs in my portfolio to be left aligned.

    Thanks in advance!

  4. InHouse
    Posted 4 years ago #

    Yes, add any CSS to nggallery.css.

    I'm not sure how your theme is configured but you should have a body class that would enable you to target specific page types or IDs along with the thumbnails. It could look something like:

    .page-id-41 .ngg-galleryoverview {
    display: block !important;
    text-align: center;

    Could be ".single", ".single-post", ".home", ".page", etc, depending on your theme and placement. All this depends on your theme using the body class <body <?php body_class( $class ); ?>> Codex - Body Class

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • NextGEN Gallery
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic