# KMG PhotoVault — Full-Width Gallery Page Setup

When the plugin creates a password-protected gallery page, it uses WordPress's
default page template. On most themes this includes the site header, sidebar,
and footer. For the best client experience, you will want the gallery to span
the full content area.

---

## Option A — Divi Theme (most common)

1. Open the gallery page in the Divi Visual Builder.
2. Click the top-level Section settings (blue gear icon).
3. Under **Layout**, set **Specialty Section** to No and remove any padding.
4. In **Page Settings** (bottom of the Visual Builder), set:
   - **Page Layout** → Full Width
   - **Hide Sidebar** → Yes (if your theme has one)
5. Save.

Alternatively, via the WP editor (Classic or Gutenberg):
1. Edit the gallery page.
2. In the Divi page metabox on the right, set **Page Layout** to `Full Width`.

---

## Option B — Elementor

1. Edit the gallery page with Elementor.
2. Click the hamburger (☰) menu → Page Settings.
3. Set **Page Layout** to **Elementor Full Width** or **Elementor Canvas**
   (Canvas removes the header and footer entirely — good for pure delivery pages).

---

## Option C — Beaver Builder

1. Edit the page with Beaver Builder.
2. Click the **Tools** menu (top left) → **Global Settings**.
3. Set the page template to **Full Width** or **No Header/Footer**.

---

## Option D — Twenty Twenty-One / Twenty Twenty-Two / Block themes

Block themes control layout via the **Site Editor** (Appearance → Editor).
For a single page, you can set a custom template:

1. Edit the gallery page.
2. In the Page panel (right sidebar) → **Template** → click **Edit**.
3. Select or create a **Blank** or **Full Width** template variant.
4. Save the template.

---

## Option E — Any theme (add a custom page template)

Add this file to your child theme as `page-kmg-gallery.php`:

```php
<?php
/*
 * Template Name: KMG Gallery (Full Width)
 * Template Post Type: page
 */
get_header();
while ( have_posts() ) {
    the_post();
    the_content();
}
get_footer();
```

Then on the gallery page, go to **Page Attributes → Template** and select
**KMG Gallery (Full Width)**.

---

## Tip — hide the sidebar globally for all gallery pages

If your theme uses a sidebar and you want all PhotoVault pages to be full-width
automatically, add this to your child theme's `functions.php`:

```php
add_filter( 'is_active_sidebar', function( $is_active, $index ) {
    if ( is_page() ) {
        $content = get_the_content();
        if ( has_shortcode( $content, 'kmg_photovault' ) ) {
            return false;
        }
    }
    return $is_active;
}, 10, 2 );
```

This detects the `[kmg_photovault]` shortcode and suppresses the sidebar
on any page that displays a gallery.

