JSON Configuration for storing GavernWP WordPress theme settings
We’ve decided to use the JSON format for storage of theme configuration settings and option layouts of the administration panel. This makes the GavernWP framework very flexible.
The following files are responsible for a theme’s configuration, and are located in the gavern/config/ catalog:
- fonts.json – This file stores a theme’s groups of fonts. By default, there are three main font groups created. To create a new group, simply add a new object to the object table located in this file.
- menus.json – Definitions for menus used in a theme are located in this file. In addition to adding a new object, you must add PHP code to generate menu data in theme’s code. There must always be one main menu (main field in menu object).
- opengraph.json – This file contains the configuration data of fields used in a block associated with the metabox used in generating Open Graph data. We do not recommend applying changes prior to getting acquainted with Open Graph tags implementation in GavernWP framework.
- styles.json – Used to generate additional theme styles. In addition to adding a new style, an additional CSS file must be loaded while changing the theme’s style.
- template.json – This is the most important configuration file. In addition to the information it contains, it allows selected elements of the theme administration panel to be disabled. It is NOT recommended for new fields to be added to this file because they cannot be used without additional PHP code.
- widgets.json – This file contains a list of all widget positions. Similar to the menus.json file, new widget positions added to this file must be matched by new PHP code in the theme.
- widgets.styles.json – A file used for creating new widget styles, it allows you to assign a particular style to a single widget type or to exclude certain widget types from any given style.
To better understand the JSON file format, we recommend visiting the official website of this format.
This article was first published