Working with themes

Revision for “Working with themes” created on October 31, 2014 @ 14:02:12

Working with themes
This is a guide to learn how to customize the css in NextCellent. <h3>1. The <strong>ngg_load_stylesheet</strong> filter</h3> The first and best option is to ask your theme author to add support for NextCellent. You can point them to this page for assistance. <strong>Note:</strong> you should not add this manually to your theme, except if you're using <a href="" target="_blank">child themes</a>, as any changes will be overwritten with a theme update. See method 2 below if you just want to change the style yourself. This filter allows you specify which stylesheet NextCellent should use. For example, drop this code in the functions.php from your current theme: <pre class="brush:php">add_filter('ngg_load_stylesheet','replace_stylesheet'); function replace_stylesheet() { return get_stylesheet_directory_uri() . "/css/mycustom-nggallery.css"; } </pre> This example tells NextCellent to load a mycustom-nggallery.css, which is located in a folder called css under the current theme. <h3>2. Using the built in style manager</h3> <strong>Note:</strong> this applies only to version 1.9.21 and up. NextCellent will find and list all css files that are in your /wp-content/ngg_styles folder. That means you can just add all the themes you want, and choose from those themes from the Style page. Also, if you select and edit a default css file (from in the css folder in the plugin), NextCellent will automatically save a the file in ngg_styles, to avoid it being overwritten by an update. In short, follow these steps: <ol> <li>Go to the Style page in the admin overview.</li> <li>Select the style you want from the dropdown. The name between brackets is the folder name.</li> <li>To add completely new themes, place the css file(s) in the wp-content/ngg_styles/ folder.</li> <li>When you've selected a file, you can edit it as well.</li> <li>When editing a file from the css folder, filename (css), NextCellent will make a copy in the ngg_styles folder of the changed file.</li> <li>When editing a file not from the css folder, NextCellent will just save your file.</li> </ol> You can also organize your css files in folders inside the ngg_styles folder, that works too. We would recommend not putting them inside a folder called css, as that would be confusing. Note: prior to version 1.9.21, the ngg_styles folder wasn't supported. That also means that if you change a css file from NextCellent itself, the changes will be overwritten by an update. <h4>3. Add your custom nggallery.css directly to the current theme path (deprecated)</h4> You can drop your custom stylesheet directly in your theme folder, but we would not recommend this, as the an update to the theme would overwrite this. Take notice: <ul> <li>File needs to be named <span style="text-decoration: underline">exactly</span> <strong>nggallery.css </strong>like the original on the plugin</li> <li>File needs to be in current theme's root</li> </ul> While this is deprecated, this option will not be removed. &nbsp; &nbsp;

OldNewDate CreatedAuthorActions
October 31, 2014 @ 14:02:12 Niko Strijbol
October 31, 2014 @ 14:01:05 [Autosave] Niko Strijbol
September 27, 2014 @ 03:25:09 Niko Strijbol
July 22, 2014 @ 07:20:26 Niko Strijbol
July 19, 2014 @ 15:48:29 Niko Strijbol
May 6, 2014 @ 10:51:36 [Autosave] admin
May 5, 2014 @ 12:51:22 admin
May 5, 2014 @ 12:50:26 admin
May 5, 2014 @ 12:45:41 admin
May 3, 2014 @ 13:23:46 admin