Beans is a theme framework for WordPress. The theme is fragmented into multiple functions which are fired using actions and filters. This makes the entire framework incredibly flexible and easy to customize.
Here is what happens when a page loads:
- The API files are loaded, making all the functions available.
- The render files are loaded, which prepares the page (setting up the layout, registering the menus, widget areas etc.).
- The structure files then load, which handle the pages structural markup (html, head, body etc.) and hooks.
- Lastly, the fragment files load, which attach the page content to the structural hooks.
Framework structure
The main lib framework folder contains a number of sub-folders. Below is a table of each folder and description.
Folder | Description |
---|---|
admin | The admin files handle what happens on the admin side such as adding the layout options, loading the WP cusomizer assets etc. |
api | The API files contains all the tools (functions) used to build Beans. These tools are incredibly powerful and you will fall in love with it once you start using them to customize or extend Beans. |
render | The render files are where all aspects of the theme is rendered, from registering menus and widget areas to loading structural template and fragment files. |
templates/structure | The structure files handle the page structural markup (html, head, body etc.) and hooks. |
templates/fragments | The fragment files handle the theme content and are split into multiple functions (fragments). These fragments are attached to the structural hooks, making it easy to move them around, make changes or remove them completely. |
languages | The languages folder contains the theme translation files, that can be used to translate all text in the front-end and back-end. |