# automattic/_s architecture

> Architecture diagram of the GitHub repository automattic/_s, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/automattic/_s
- Repository: https://github.com/automattic/_s

## Overview

Underscores (_s) is an archived WordPress starter theme intended to be customized into a complete theme, not used as a parent theme. Its main workflow is WordPress selecting a PHP template for a request, rendering post or page content through template parts and helper tags, and assembling the page with shared theme elements and styles. The graph also preserves documented theme customization, responsive navigation, and WooCommerce and Jetpack compatibility. Some template and integration details are represented only at their documented or visible call boundaries; unsampled behavior is not inferred.

Main entry points: [`functions.php`](https://github.com/automattic/_s/blob/master/functions.php) (Theme setup), [`index.php`](https://github.com/automattic/_s/blob/master/index.php) (Default template), [`search.php`](https://github.com/automattic/_s/blob/master/search.php) (Search template), [`inc/template-tags.php`](https://github.com/automattic/_s/blob/master/inc/template-tags.php) (Template tags)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Theme runtime"]
  node_bootstrap["Theme setup<br/>[functions.php]"]
  node_index["Default template<br/>[index.php]"]
  node_search["Search template<br/>[search.php]"]
  node_archive["Archive template<br/>[archive.php]"]
  node_single["Single template<br/>[single.php]"]
  node_page["Page template<br/>[page.php]"]
end

subgraph group_content["Content rendering"]
  node_notfound["Not found<br/>[content-none.php]"]
  node_contentpost["Post content<br/>[content.php]"]
  node_contentsearch["Search result<br/>[content-search.php]"]
  node_contentpage["Page content<br/>[content-page.php]"]
  node_tags["Template tags<br/>[template-tags.php]"]
end

subgraph group_interface["Theme interface"]
  node_header["Shared header<br/>[header.php]"]
  node_footer["Shared footer<br/>[footer.php]"]
  node_sidebar["Sidebar<br/>[sidebar.php]"]
  node_navigation["Menu behavior<br/>[navigation.js]"]
  node_styles["Theme styling<br/>[style.scss]"]
  node_customheader["Custom header<br/>[custom-header.php]"]
  node_customizer["Customizer support<br/>[customizer.php]"]
  node_customizerjs["Live preview<br/>[customizer.js]"]
end

subgraph group_integrations["Plugin integrations"]
  node_woocommerce["WooCommerce support<br/>[woocommerce.php]"]
  node_jetpack["Jetpack support<br/>[jetpack.php]"]
end

node_visitor(("Site visitor"))
node_wordpress["WordPress"]

node_visitor -.->|"requests page"| node_wordpress
node_wordpress -.->|"selects fallback"| node_index
node_bootstrap -->|"loads"| node_customheader
node_bootstrap -->|"loads"| node_tags
node_bootstrap -->|"loads"| node_customizer
node_bootstrap -->|"conditionally loads"| node_woocommerce
node_bootstrap -->|"conditionally loads"| node_jetpack
node_bootstrap -->|"enqueues"| node_navigation
node_index -->|"renders"| node_contentpost
node_index -->|"renders"| node_notfound
node_index -->|"loads"| node_header
node_index -->|"loads"| node_sidebar
node_index -->|"loads"| node_footer
node_search -->|"renders"| node_contentsearch
node_search -->|"renders"| node_notfound
node_search -->|"loads"| node_header
node_search -->|"loads"| node_sidebar
node_search -->|"loads"| node_footer
node_contentpost -->|"calls"| node_tags
node_contentsearch -->|"calls"| node_tags
node_bootstrap -->|"enqueues stylesheet"| node_styles
node_bootstrap -.->|"supports live preview"| node_customizerjs

click node_bootstrap "https://github.com/automattic/_s/blob/master/functions.php"
click node_index "https://github.com/automattic/_s/blob/master/index.php"
click node_search "https://github.com/automattic/_s/blob/master/search.php"
click node_archive "https://github.com/automattic/_s/blob/master/archive.php"
click node_single "https://github.com/automattic/_s/blob/master/single.php"
click node_page "https://github.com/automattic/_s/blob/master/page.php"
click node_notfound "https://github.com/automattic/_s/blob/master/template-parts/content-none.php"
click node_contentpost "https://github.com/automattic/_s/blob/master/template-parts/content.php"
click node_contentsearch "https://github.com/automattic/_s/blob/master/template-parts/content-search.php"
click node_contentpage "https://github.com/automattic/_s/blob/master/template-parts/content-page.php"
click node_tags "https://github.com/automattic/_s/blob/master/inc/template-tags.php"
click node_header "https://github.com/automattic/_s/blob/master/header.php"
click node_footer "https://github.com/automattic/_s/blob/master/footer.php"
click node_sidebar "https://github.com/automattic/_s/blob/master/sidebar.php"
click node_navigation "https://github.com/automattic/_s/blob/master/js/navigation.js"
click node_styles "https://github.com/automattic/_s/blob/master/sass/style.scss"
click node_customheader "https://github.com/automattic/_s/blob/master/inc/custom-header.php"
click node_customizer "https://github.com/automattic/_s/blob/master/inc/customizer.php"
click node_customizerjs "https://github.com/automattic/_s/blob/master/js/customizer.js"
click node_woocommerce "https://github.com/automattic/_s/blob/master/inc/woocommerce.php"
click node_jetpack "https://github.com/automattic/_s/blob/master/inc/jetpack.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_bootstrap,node_index,node_search,node_archive,node_single,node_page toneBlue
class node_notfound,node_contentpost,node_contentsearch,node_contentpage,node_tags toneAmber
class node_header,node_footer,node_sidebar,node_navigation,node_styles,node_customheader,node_customizer,node_customizerjs toneMint
class node_woocommerce,node_jetpack toneRose
class node_visitor,node_wordpress toneIndigo
```

## Components

### Theme runtime

- [Theme setup](https://github.com/automattic/_s/blob/master/functions.php): `functions.php`
- [Default template](https://github.com/automattic/_s/blob/master/index.php): `index.php`
- [Search template](https://github.com/automattic/_s/blob/master/search.php): `search.php`
- [Archive template](https://github.com/automattic/_s/blob/master/archive.php): `archive.php`
- [Single template](https://github.com/automattic/_s/blob/master/single.php): `single.php`
- [Page template](https://github.com/automattic/_s/blob/master/page.php): `page.php`

### Content rendering

- [Not found](https://github.com/automattic/_s/blob/master/template-parts/content-none.php): `template-parts/content-none.php`
- [Post content](https://github.com/automattic/_s/blob/master/template-parts/content.php): `template-parts/content.php`
- [Search result](https://github.com/automattic/_s/blob/master/template-parts/content-search.php): `template-parts/content-search.php`
- [Page content](https://github.com/automattic/_s/blob/master/template-parts/content-page.php): `template-parts/content-page.php`
- [Template tags](https://github.com/automattic/_s/blob/master/inc/template-tags.php): `inc/template-tags.php`

### Theme interface

- [Shared header](https://github.com/automattic/_s/blob/master/header.php): `header.php`
- [Shared footer](https://github.com/automattic/_s/blob/master/footer.php): `footer.php`
- [Sidebar](https://github.com/automattic/_s/blob/master/sidebar.php): `sidebar.php`
- [Menu behavior](https://github.com/automattic/_s/blob/master/js/navigation.js): `js/navigation.js`
- [Theme styling](https://github.com/automattic/_s/blob/master/sass/style.scss): `sass/style.scss`
- [Custom header](https://github.com/automattic/_s/blob/master/inc/custom-header.php): `inc/custom-header.php`
- [Customizer support](https://github.com/automattic/_s/blob/master/inc/customizer.php): `inc/customizer.php`
- [Live preview](https://github.com/automattic/_s/blob/master/js/customizer.js): `js/customizer.js`

### Plugin integrations

- [WooCommerce support](https://github.com/automattic/_s/blob/master/inc/woocommerce.php): `inc/woocommerce.php`
- [Jetpack support](https://github.com/automattic/_s/blob/master/inc/jetpack.php): `inc/jetpack.php`

### Other components

- **Site visitor**
- **WordPress**

## Connections

- Site visitor → WordPress: requests page
- WordPress → Default template: selects fallback
- Theme setup → Custom header: loads (evidence: `functions.php`)
- Theme setup → Template tags: loads (evidence: `functions.php`)
- Theme setup → Customizer support: loads (evidence: `functions.php`)
- Theme setup → WooCommerce support: conditionally loads (evidence: `functions.php`)
- Theme setup → Jetpack support: conditionally loads (evidence: `functions.php`)
- Theme setup → Menu behavior: enqueues (evidence: `functions.php`)
- Default template → Post content: renders (evidence: `index.php`)
- Default template → Not found: renders (evidence: `index.php`)
- Default template → Shared header: loads (evidence: `index.php`)
- Default template → Sidebar: loads (evidence: `index.php`)
- Default template → Shared footer: loads (evidence: `index.php`)
- Search template → Search result: renders (evidence: `search.php`)
- Search template → Not found: renders (evidence: `search.php`)
- Search template → Shared header: loads (evidence: `search.php`)
- Search template → Sidebar: loads (evidence: `search.php`)
- Search template → Shared footer: loads (evidence: `search.php`)
- Post content → Template tags: calls (evidence: `template-parts/content.php`)
- Search result → Template tags: calls (evidence: `template-parts/content-search.php`)
- Theme setup → Theme styling: enqueues stylesheet (evidence: `functions.php`)
- Theme setup → Live preview: supports live preview
