Title: Layout broken in default ImageBrowser template
Last modified: July 29, 2026

---

# Layout broken in default ImageBrowser template

 *  [ulenka1984](https://wordpress.org/support/users/ulenka1984/)
 * (@ulenka1984)
 * [1 week, 3 days ago](https://wordpress.org/support/topic/layout-broken-in-default-imagebrowser-template/)
 * I am writing to report **two critical issues** that appeared immediately after
   updating the plugin from version 3.59.12 to version 4.2.3. Both issues only affect
   the new **default ImageBrowser template**, while Legacy templates work correctly.
 * **The Issue in the Code:**
 * At the end of `default-view.php`, I found this:
 * `</div> </div> </div> <?php $this->end_element(); ?>`
 * There are **three** closing `</div>` tags, but only **one** is needed to close
   the `.ngg-imagebrowser` container.
 * **Correct structure should be:**
 * `</div> <?php $this->end_element(); ?>`

Viewing 1 replies (of 1 total)

 *  Plugin Support [Mihai](https://wordpress.org/support/users/mceban/)
 * (@mceban)
 * [1 week, 2 days ago](https://wordpress.org/support/topic/layout-broken-in-default-imagebrowser-template/#post-18979468)
 * Hi [@ulenka1984](https://wordpress.org/support/users/ulenka1984/) ,
 * Thank you for reading through the template source and sending such a detailed
   report.
 * You’re right, and I want to confirm that plainly: this is a bug in our plugin.
   I’ve passed your finding to our development team.
 * The default Image Browser template ends with three closing “</div>” tags, and
   only one of them belongs there. The template opens six “<div>” elements, and 
   five of those are already closed earlier in the file. By the time you reach the
   end, only the outer gallery container is still open, so a single closing tag 
   is all it needs.
 * The two spare tags don’t sit there harmlessly. They close whichever containers
   your theme has wrapped around the gallery. That is why post content after a gallery
   can slide out of position or wrap into the navigation buttons.
 * Your proposed fix is the correct one. I’ve added it to our existing report about
   the ImageBrowser, so the markup problem and the navigation problem are now tracked
   in the same place.
 * **If you need a clean page before the fix ships**
 * You can override the template so your correction survives plugin updates. Create
   this file on your site:
 * `wp-content/ngg/modules/photocrati-nextgen_basic_imagebrowser/templates/nextgen_basic_imagebrowser.
   php`
 * Copy the full contents of `nextgen-gallery/templates/ImageBrowser/default-view.
   php` into it. Then remove the two spare closing tags at the end, so the last 
   two lines read:
 *     </div>
 * <?php $this->end_element(); ?>
 * NextGEN Gallery looks in that folder before it uses its own copy, and nothing
   in that folder is touched when the plugin updates. One caveat: because it is 
   a full copy, you would need to bring over any later changes we make to that template
   by hand. Once our fix is released you can delete the override and go back to 
   the shipped version.
 * Thanks again for the detail here.
 * Best,
   Mihai

Viewing 1 replies (of 1 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Flayout-broken-in-default-imagebrowser-template%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](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/)

 * 1 reply
 * 2 participants
 * Last reply from: [Mihai](https://wordpress.org/support/users/mceban/)
 * Last activity: [1 week, 2 days ago](https://wordpress.org/support/topic/layout-broken-in-default-imagebrowser-template/#post-18979468)
 * Status: not resolved