-
Notifications
You must be signed in to change notification settings - Fork 71
Customizing JSON
For advanced users, the Apple News plugin allows you to customize JSON. Each Apple News component that is handled by the plugin has one or more JSON specs for the main component JSON, layouts and/or styles. Some components have multiple specs for each of those if they have different visual appearances in different contexts. Editing these specs allows you to implement more advanced features from Apple News Format than can be handled via theme settings.
To get started, go to Customize JSON from the Apple News menu:
Next, select the component you wish to edit from the dropdown:
You will then see a form that shows the editable JSON specs for that component.
Some specs will include values in the format %%token%%
. These are tokens that represent dynamic values that will be inserted into the JSON when the post is published to Apple News. These may be post-specific values or values that come from the theme. You may remove tokens if you want, but you cannot add new ones since there are a specific set of tokens that are supported by each spec.
When you have finished editing, click the Save JSON button. The new specs will now be used for that component when publishing posts to Apple News moving forward.
The following components and JSON specs are supported:
The main component JSON.
The default component layout.
The main component JSON.
The main component JSON.
The default component layout.
Layout settings for the last body component only.
The default component style.
The style for the first body component when drop caps are enabled.
The main component JSON.
The default component style.
The default component layout.
The main component JSON.
The default component layout.
The component layout to use when the cover is positioned below text.
The main component JSON.
The default component layout.
The main component JSON.
The main component JSON.
The main component JSON.
The default component layout.
The main component JSON.
The default component layout.
The style for level 1 (H1) components.
The style for level 2 (H2) components.
The style for level 3 (H3) components.
The style for level 4 (H4) components.
The style for level 5 (H5) components.
The style for level 6 (H6) components.
For support, please file an issue here on GitHub or visit the WordPress.org support forum.