This code-owned post demonstrates how the Knowledge Hub post format works within the BTPress theme. Each article lives in a flat folder under templates/posts/ and renders at its slug URL with no database entries required.
Architecture of the Route System
The route system maps public URL paths to folder slugs. A post in templates/posts/agent-owned-content/ renders at /agent-owned-content/ automatically. The route loader discovers it at boot and registers it alongside fixed page routes.
Code-owned content gives you the precision of static files with the flexibility of a dynamic system.
Key Principles
Metadata like title, date, category, and card image live in meta.php beside the template. The archive page reads these to build its post cards. No admin interface, no synchronization errors — the file is the source of truth.
Key Takeaways
- 01 Posts live in flat folders. Public URLs stay clean without nested archives.
-
02
Metadata in
meta.phpdrives all card and SEO data automatically. - 03 The template renders any content — prose, diagrams, interactive components.
Route-local media lives in the post's media/ subfolder. Use get_current_route_file_url() to reference it safely. Shared brand assets live under assets/ at the theme root.