WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. comatosed
    Member
    Posted 2 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:

    http://mygraphicfriend.wordpress.com/2010/01/11/custom-style-sheet-and-templates-for-nextgen-gallery-with-special-instructions-for-child-themes/

    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,

    Greg

    http://wordpress.org/extend/plugins/nextgen-gallery/

  2. inhouse
    Member
    Posted 2 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 {
    width:100px;
    float:left;
    }
    
    #ngg-gallery-2-245 .ngg-gallery-thumbnail {
    width:60px;
    float:right;
    }
  3. comatosed
    Member
    Posted 2 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!
    -Greg

  4. inhouse
    Member
    Posted 2 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

About this Topic