• Resolved BigIronCruiser

    (@bigironcruiser)


    I need to control the height of Nextgen galleries using CSS, but it looks like the suffix changes each time a page is edited and saved/updated.

    As an example, I have a page with a Nextgen gallery followed by some text. These are the gallery ID’s before & after editing the text, and then saving/updating the page:

    Before: ngg-slideshow-1570-1694544130
    After: ngg-slideshow-1570-6343422320

    Since the complete gallery ID isn’t static, what’s the best approach for referencing the galleries in CSS?

    https://wordpress.org/plugins/nextgen-gallery/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor photocrati

    (@photocrati)

    @bigironcruiser – If you need to address each specific slideshow then you will need to update your CSS each time you edit it … if you are wanting to address all slideshows then you can use the ngg-slideshow class.

    – Cais.

    Thread Starter BigIronCruiser

    (@bigironcruiser)

    That’s really inconvenient, and it seems rather senseless to change the ID if nothing about the gallery has changed. What’s the purpose of changing the ID? Is it changed by the Nextgen Plugin?

    Benjamin

    (@benjaminowens)

    The gallery ID shouldn’t change on every page load, only if you change the settings to that gallery.

    Are you using a shortcode or the Attach-To-Post window, or is your gallery a ‘random’ one?

    Thread Starter BigIronCruiser

    (@bigironcruiser)

    The ID doesn’t change when the page is loaded. It’s when the page containing the gallery is edited in WP-Admin and then saved/updated. This happens EVEN when the edit has NOTHING to do with the Nextgen Gallery.

    Benjamin

    (@benjaminowens)

    My apologies, I was wrong–the basic slideshows ID is set in adapter.nextgen_basic_slideshow_controller.php to 'ngg-slideshow-' . $displayed_gallery->id() . '-' . rand(1, getrandmax()) . $current_page which will definitely add an unwanted random number to the ID. This is evidently meant for compatibility in case the same slideshow is present more than once on a page, but it was implemented incorrectly.

    I’ve made a note of this to try to get it fixed in the next major release, but until then you could try editing nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/slideshow/index.php to add data-gallery-id='<?php esc_attr_e($displayed_gallery_id); ?>' to the div.ngg-slideshow-image-list element.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Referencing Galleries in CSS’ is closed to new replies.