Start here
A theme changes Forma in three ways: it copies a template and edits it, sets CSS variables, or registers its own styles and fields with filters. All of it works the same in the free plugin and in Pro.
Where theme files go
Everything a theme adds lives in a forma/ folder of the theme, at the same path as in the plugin’s templates/ folder:
your-theme/
forma/
skins/my-card/skin.php a card style
skins/my-card/settings.php its fields in the editor
skins/my-card/style.css loads only where the style is used
filters/pills/filter.php a filter style
layouts/carousel/layout.php a layout type
notices/empty.php an override of a built-in template
icons/chevron-left.svg an override of an icon
A child theme’s files win over the parent’s.
Find your task
| I want to | Read |
|---|---|
| Change the markup of a card, a control or a notice | Templates and icons |
| Change colors, corners or spacing | Restyle with CSS |
| Add a card design of my own | Add a card style |
| Give my card style options in the editor | Skin settings |
| Add fields to the layout editor | Extend Forma → Editor fields |
| Add a layout type, an animation or a Metro pattern | Extend Forma → Layout types, Animations and patterns |
| Run my script after filtering or Load More | Extend Forma → JavaScript events |
| Change the query or the data of each item | Extend Forma → Recipes |
| Look up a function, hook or setting | Developer reference |
Use the functions, not the classes
Call the functions Forma lists in Developer reference → Theme functions. The classes behind them may move from one version to the next; the functions stay.
// Layout 123, as its shortcode prints it
echo forma_render( 123 );
// Only its filter, for a sidebar
echo forma_render( 123, [ 'show' => 'filter' ] );
// Something for Pro sites only
if ( forma_is_pro() ) {
// …
}
Was this article helpful?
Thanks for your feedback!