Introduction to Hooks & Filters
- Hooks and filters
- Difference between hooks and filters
- Terminology
- Simple hook calls
- Extended hook calls
- Extended hook options
- Hook partial location
- Disabling unused hook messages
- Recommended usage pattern
Hooks and filters #
Ananke provides a small hooks system that lets site projects inject or transform markup without changing the theme templates directly.
Hook examples
This page collects worked examples for the theme’s hook points. Each one shows the partial you create, where the output lands, and why you would reach for that particular hook.
If you have not read it yet, start with the introduction for the call mechanics, and keep the list of all hooks handy for the available hook names.
- Before you start
- Add a third-party script in the head
- Defer analytics to the end of the body
- Add a site-wide announcement bar
- Extend the footer (and cache it)
- Add secondary navigation using the page context
- Add an author bio after the content
- Override the article section link
- Use a hook as a filter
Before you start #
Every example below is a file you create in your site, never in the theme:
All Hooks & Filters
This page lists every hook point the theme wires into its templates. Each entry is the value you
pass as the hook key (see the introduction for how to call hooks and
filters).
A hook point does nothing until your site provides a matching partial at
layouts/_partials/hooks/<name>.html. Until then the hook is “unused” — the theme prints an
optional debug notice and renders nothing.