Envira Gallery Documentation

Documentation, Reference Materials and Tutorials for Envira Gallery

CSS Addon

One of the Envira Gallery plugin’s greatest strengths is how customizable it is, even for users who don’t have any coding experience! What’s even better for power users is that, if you do know some CSS, you can take that customization even further. 

With the CSS Addon, you can add custom CSS options to specific galleries to shape, format, and mold exactly how you want them to appear on your website pages. Here, we’ll cover how to install and use the CSS Addon for Envira Gallery.


Requirements

  • Any Envira license (Pro or higher)
  • WordPress 4.9+
  • Envira Gallery 1.3.4.1+

Installation

The CSS Addon, like any other addon, can be installed in one of two ways: either through the Envira Gallery dashboard or manually from the Envira Gallery page. For help learning how to install and activate Envira addons, follow our instructions here

Remember, in this instance, you’ll want to activate the Envira CSS Addon.

Setup

Step 1 – Create or Edit Your Gallery

The CSS Addon allows you to create custom CSS code for your gallery. This works on a per-gallery basis.

In order to customize your gallery, you first have to have created one! Either create a new Envira Gallery, or select an existing gallery to customize with CSS. You can follow along with our documentation for creating your first gallery to get started.

Step 2 – Add Your CSS

Once you’ve created a new gallery or chosen one to customize, select that gallery and click the Misc tab in the settings panel on the gallery edit page.

Scroll down to the Custom Album CSS field, located below the Enable RTL Support feature:

Here’s where you’ll enter your custom CSS. Note: the instructions state that you should label your custom CSS sections with #envira-gallery-xx (where xx is the internal number of your gallery). This ensures that customizations you make to your gallery only apply to the gallery you’ve edited. Remember, CSS customizations are applied per gallery.

The customizations can be as simple or advanced as you want. For example, you can create gallery-wide changes to the margins. In CSS terms, a “margin” is the outside space of an element… When you have larger margins, you create more space around the outside of the gallery.

So, if you add the following CSS to your gallery, you’ll create a 40-pixel space around the gallery on all sides:

#envira-gallery-xx { margin: 40px 0; }

Likewise, if you add the following CSS to the field, you’ll create a border 5 pixels thick around each image inside the gallery:

#envira-gallery-xx .envira-gallery-image { border: 5px solid #222; }

Of course, these are just two of the customization options available to you with the CSS addon. Really, the possibilities for tailoring your Envira Gallery are endless.

Step 3 – Publish or Update Your Gallery

Once you’re happy with the customizations you’ve made to your Envira gallery, simply publish your new gallery or update your existing gallery by clicking the Publish or Update button. These buttons can be found in the same location on the right-hand side of the screen.

Finally, click Publish or Update on your gallery to save the changes.

The customizations and adjustments you can make with the CSS Addon are pretty limitless. With that in mind, here are some sample styling guidelines you can use to help you fully leverage the power of Envira Gallery and custom CSS.


FAQs

Q: How can I get started writing CSS for Envira Gallery?

A: CSS is its own coding language with a ton of options and rules. Your best bet, outside of learning the specific Envira Gallery rules, is to learn the basics of CSS here. But, if you’re looking to learn CSS with the sole intention of customizing your gallery, try this tutorial instead.


Q: Why isn’t my CSS change showing?

A: Check that you’ve added your CSS to the Custom Gallery CSS field and not the Custom Gallery Classes field (shown below).

The Custom CSS field is located in the Misc tab when editing your gallery.


Q: Is this the only way to add CSS?

A: Nope! You can use the WordPress customizer to add Additional CSS to change your galleries or even customize your theme. Check out our guide on How to add custom CSS to the WordPress Customizer.


Q: Does custom CSS work for albums, too?

A: Absolutely! On the Misc tab of an Envira Album, you’ll see the same options to add your CSS. Simply follow the same steps as those outlined above to customize your Envira albums with CSS.


Changelog

1.3.4 (02-05-2020)

  • Fix: Remove unused "harmless" CSS code when no custom code added for a gallery.

1.3.3 (06-04-2019)

  • Fix: Minor bug fixes.

1.3.2 (10-26-2018)

  • Enhancement: Improved UI and error checking for entering CSS

1.3.1 (05-30-2018)

  • Fix: Minor bug fixes.

1.3.0 (04-10-2018)

  • Added: Fancybox3 support.
  • Fix: Minor bug fixes.

1.2.0 (10-18-2017)

  • Fix: Minor bug fixes.

1.1.0 (02-01-2017)

  • Fix: Escaped Quotes when saving

1.0.9 (2016-10-04)

  • Fix: Custom CSS box should now longer strip out anything after the quotes on HTML characters.

1.0.8 (2016-02-25)

  • Updated: Spanish Translations

1.0.7 (2015-12-10)

  • Updated: Spanish Translation

1.0.6 (2015-11-26)

  • Added: Spanish translation.

1.0.5

  • Added: CSS Support for Albums Addon.

1.0.4

  • Full localization support with .pot files.

1.0.3

  • Fixed bug with HTML entity encoding for quotes in CSS.

1.0.1

  • Fixed bug using wrong hook for setting.

1.0.0

  • Initial release of the addon.
[i]
[i]