Title: Please update CSS
Last modified: August 22, 2016

---

# Please update CSS

 *  Resolved [Squazz](https://wordpress.org/support/users/squazz/)
 * (@squazz)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/please-update-css/)
 * Many places nextGen is using !important in the standard styles. This gives quite
   a few problems.
 * One would think that enabling custom styles in the settings, and then overriding
   the styles with an !important tag would solve the problem. But apparently NextGen
   loads the custom styles first, and then loads the basic styles. Overriding the
   custom styles, even though we set the !important flag to ensure that we override
   the styles nextGen provides us with.
 * The only way for me to solve this at the moment is to create a new stylesheet,
   and then force it to be the last thing loaded on the site. Not really a good 
   practice.
 * [https://wordpress.org/plugins/nextgen-gallery/](https://wordpress.org/plugins/nextgen-gallery/)

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

 *  Thread Starter [Squazz](https://wordpress.org/support/users/squazz/)
 * (@squazz)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/please-update-css/#post-5593983)
 * For future readers, if the problem does not get resolved. The following code 
   lets us load the styles after NextGen is done loading everything.
 *     ```
       // NextGen gallery fix
       function NextGen_styles_fix() {
          wp_enqueue_style( 'NextGen-Responsive', get_stylesheet_directory_uri() . '/styles/nggallery.css', array('nextgen_basic_thumbnails_style') );
       }
       add_action( 'wp_enqueue_scripts', 'NextGen_styles_fix' );
       ```
   
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/please-update-css/#post-5594080)
 * [@squazz](https://wordpress.org/support/users/squazz/) – Thanks for sharing this.
   Something also to consider to ensure the custom additional stylesheet is enqueued
   last/later is to add a priority parameter, for example:
 * `add_action( 'wp_enqueue_scripts', 'NextGen_styles_fix', 123 );`
 * Thanks!
 * – Cais.
 * NB: The value of `123` is for example purposes only and not meant as a specific
   parameter value setting.
 *  Thread Starter [Squazz](https://wordpress.org/support/users/squazz/)
 * (@squazz)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/please-update-css/#post-5594084)
 * With the dependency array(‘nextgen_basic_thumbnails_style’) I ensure just that
   🙂 Maybe you should encoporate for when the plugin is looking for the custom 
   styles?
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/please-update-css/#post-5594088)
 * [@squazz](https://wordpress.org/support/users/squazz/) – The dependency ensure
   that the stylesheet is only enqueued if the first exists, it does not necessarily
   set a priority that will ensure it is enqueued afterward. You can look at the
   priority parameter as a failsafe in this case.
 * – Cais.
 * PS: I also did not notice you added the dependency the first read through, which
   is a very good idea as well.
 *  Thread Starter [Squazz](https://wordpress.org/support/users/squazz/)
 * (@squazz)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/please-update-css/#post-5594094)
 * From the WordPress codex:
    “Array of the handles of all the registered scripts
   that this script depends on, that is the scripts that must be loaded before this
   script…” Read more about it here: [http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Parameters](http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Parameters)
 * As I understand it, the style with the handle “nextgen_basic_thumbnails_style”
   has to be loaded, not just registered, before things dependend on this handle
   is being loaded?
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/please-update-css/#post-5594097)
 * [@squazz](https://wordpress.org/support/users/squazz/) – That is what the codex
   says, but have you traced our code to ensure what you expect is happening actually
   does? Unfortunately, in order to ensure the widest compatibility with as many
   plugins as possible, there are cases where the enqueue order may not necessarily
   be what is expected when it comes to our specific stylesheets and scripts.
 * Thanks!
 * – Cais.
 *  Thread Starter [Squazz](https://wordpress.org/support/users/squazz/)
 * (@squazz)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/please-update-css/#post-5594098)
 * I trust you, I have only been working with WordPress for 4 months 🙂
 * I hope that at one point the !important tags will be removed, or at least that
   the load order will be fixed 🙂
 * Thanks for your time to reply
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/please-update-css/#post-5594102)
 * [@squazz](https://wordpress.org/support/users/squazz/) – There are definitely
   improvements coming out in the next (major) release (2.0.68+) and I agree the
   load order is a point of contention (which we are always working on); and, at
   times, something we find quite challenging as we try to ensure we keep compatibility
   intact for as many other plugins as possible.
 * Thanks … and you definitely appear to be getting a good handle on WordPress from
   the topics you are involved with in this forum.
 * – Cais.
 *  Thread Starter [Squazz](https://wordpress.org/support/users/squazz/)
 * (@squazz)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/please-update-css/#post-5594106)
 * Thank you so much for the kind words 🙂
 * I have studie computerscience for 2 years, so I do have an idea about what it
   is that I am doing. But much of the time I use on learning how WordPress handles
   different aspects, and also how plugin developers are thinking 🙂
 * And yeah, I have gotten myself into quite a few topics over the last few months
   😛
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/please-update-css/#post-5594110)
 * [@squazz](https://wordpress.org/support/users/squazz/) – Excellent! keep at it:)
 * -Drew

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

The topic ‘Please update CSS’ is closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

 * 10 replies
 * 2 participants
 * Last reply from: [photocrati](https://wordpress.org/support/users/photocrati/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/please-update-css/#post-5594110)
 * Status: resolved