What Is GeneratePress
GeneratePress is a parent theme. Do not edit files in /wp-content/themes/generatepress/ on production. Use a child theme or GP Premium Elements for customizations.
What GeneratePress Is (and What It Is Not)
GeneratePress is a performance-oriented WordPress theme designed to be extended without forking the parent theme.
It is:
- A parent theme with predictable templates and hook points
- A "system" theme: you set global defaults in the Customizer and then override selectively
- A good fit for block-based builds (especially with GenerateBlocks)
It is not:
- A page builder (it does not replace the editor)
- A "do everything" theme that ships dozens of heavy features by default
- A workflow where you should edit parent theme files
| Topic | What it means | Where it lives |
|---|---|---|
| Parent theme | The baseline theme WordPress loads | /wp-content/themes/generatepress/ |
| Child theme | Your customization layer that survives updates | /wp-content/themes/generatepress-child/ |
| Hook-first design | Customizations happen via actions/filters | do_action( 'generate_*' ) / apply_filters( 'generate_*' ) |
| Modular core | Logic is split into focused modules | /wp-content/themes/generatepress/inc/ |
| Lightweight assets | Minimal CSS/JS by default | /wp-content/themes/generatepress/assets/ |
How GeneratePress Works
At runtime, WordPress loads the parent theme, then your child theme (if present). GeneratePress templates render the structure of the page and fire hook points. Your customizations attach to those hook points.
flowchart TD
OLS[OpenLiteSpeed] --> WP[WordPress]
WP --> GP["GeneratePress (parent theme)"]
GP --> HOOKS[generate_* hooks]
HOOKS --> CHILD[Child theme callbacks]
WP --> PLUGINS[Plugins: GP Premium, GenerateBlocks]
In practice, you usually extend GeneratePress with one of these approaches:
| Approach | Best for | Tradeoffs |
|---|---|---|
| Customizer + blocks | Most sites | Fast iteration; settings live in DB |
| Elements (GP Premium) | Conditional output/layout changes | Great targeting; can become hard to audit if unmanaged |
| Child theme or site plugin | Versioned code, integrations, custom logic | Requires dev workflow; needs deployment discipline |
<?php
add_action( 'generate_after_header', function () {
echo '<div class="notice">Free audit slots available this week.</div>';
} );
The key idea is not the specific hook name. The key idea is: you add behavior by attaching callbacks to known hook points.
Where GeneratePress Lives on Disk
You rarely need to read theme files, but it helps to know the map when debugging.
| Path | What it contains | Why you care |
|---|---|---|
/wp-content/themes/generatepress/ | Parent theme code | Upgrade-safe reference, not an edit target |
/wp-content/themes/generatepress/inc/ | Core PHP modules | Where most theme logic is organized |
/wp-content/themes/generatepress/templates/ | Template files | Rendering structure and includes |
/wp-content/themes/generatepress/assets/ | CSS/JS assets | Performance profiling and overrides |
Key Concepts and Terminology
| Term | Practical meaning |
|---|---|
| Hook | A named insertion point that runs your code |
| Filter | A hook that modifies a value and returns it |
| Theme mods | Stored Customizer settings for the theme |
| Template override | Copying a theme template into a child theme (high maintenance) |
Common Misconceptions
- "I should edit the parent theme once and remember it" (updates will overwrite you)
- "More features means a better theme" (more features often means more weight)
- "Hooks are only for developers" (Elements makes hooks usable without editing theme files)
Quick Reference
| If you want to... | Usually use... |
|---|---|
| Set global typography/colors/spacing | Customizer |
| Inject a banner/CTA conditionally | Elements (Hook/Block) |
| Add durable code (schema, APIs, integrations) | Site plugin / MU-plugin |
| Change layout by context | Elements (Layout) or filters |
What's Next
- Next: Why Professionals Use GeneratePress
- Related: Theme Architecture