# United Pets WordPress Theme

United Pets 1.0.3 is a hybrid Gutenberg WordPress theme converted from the supplied United Pets static template. Gutenberg stores editable section values and WordPress records while server-side renderers preserve the supplied frontend DOM, classes, assets, responsive behavior and interaction hooks.

## Installation and demo import

1. Upload `united-pets.zip` under **Appearance → Themes → Add New → Upload Theme** and activate it.
2. After activation, use the United Pets admin notice to open **Appearance → Import Demo**, or open that submenu directly.
3. Click **Delete existing content and import demo**.

**Import Demo is intentionally destructive.** It deletes all existing site content, including Pages, Posts, stored custom post types, Media Library items, comments, terms and navigation menus, then rebuilds the bundled demo from zero with the dedicated United Pets page templates. Users, plugins and site configuration are retained.

Theme activation registers the United Pets post types/taxonomy and immediately flushes WordPress rewrite rules before activation completes. On a new site, the theme enables post-name permalinks. Import Demo flushes rewrite rules again after rebuilding the content/routes.

## Editing

- **Pages → Edit**: dedicated United Pets page templates for Home, About, Gallery, Careers, Adoption Stories, Elements, Contact and Blog. Imported pages are assigned their matching template automatically.
- **Gutenberg source sections**: select a section to edit its primary fields inline; **Edit all source text, links and images** exposes the rest of the preserved source content. Source previews are local editor previews and do not depend on block-renderer REST responses.
- **United Pets page layouts**: the block inserter includes **United Pets Pages** patterns, and the Page editor's **United Pets layout** panel can load/reload the canonical block composition for the selected dedicated template. Empty pages auto-populate when a United Pets template is selected.
- **Posts → Edit**: blog records and Gutenberg article content.
- **Pets / Services / Events / Team**: structured records used by dynamic source-preserving archives and cards.
- **Appearance → Menus**: primary navigation hierarchy and links.
- **Appearance → Customize**: contact details, social links, footer copy/hours, logo and optional Google-font loading.

The custom blocks are `united-pets/source-section`, `united-pets/query-cards` and `united-pets/contact-form`. They expose structured controls and render source-derived markup rather than page-sized Custom HTML blocks. Named source-section and dynamic-card variations are available directly from the block inserter. Dynamic cards preview the actual WordPress records and link to their edit screens.

## Content model

- Native Posts for the blog.
- `up_pet` for adoptable pets, with `up_pet_type` taxonomy and breed/age/gender/size metadata.
- `up_service` for pet services.
- `up_event` for events with date/time/location metadata.
- `up_team_member` for staff profiles and role/contact metadata.
- Native Pages for editorial/static content.

No ACF, page builder or required plugin dependency is used.

## Forms and maps

Contact submission uses nonce-protected WordPress AJAX/`wp_mail()`. Newsletter signup is nonce protected and stored as private WordPress records. The legacy static `sendmail.php`/PHPMailer runtime is intentionally not shipped. Production email delivery may require normal host/SMTP configuration.

Event and Contact maps use the supplied Leaflet/OpenStreetMap behavior and require no API key. The bundled marker URL is resolved through the active theme URL.

## Source preservation and verification

`SOURCE-PRESERVATION-MANIFEST.json` records the source file/selector, CSS, JavaScript, output owner, editable fields and allowed deviations for each public component. The source HTML/static assets are frozen under `source/`; executable legacy PHP mail code is excluded.

Repository release evidence is stored under `docs/evidence/united-pets/`. It includes paired source/WordPress screenshots and machine-readable DOM/computed-style evidence, responsive browser results, admin/editor checks, package validation and fresh-install evidence.

## Licensing

Theme-authored PHP, WordPress integration code and compatibility code are GPL-2.0-or-later. Bundled third-party libraries, template assets, fonts and imagery retain their respective upstream/source-package licenses; see `ASSET-CREDITS.md`. Possession of this theme does not expand rights granted by those third-party licenses.
