Created
September 11, 2018 17:55
-
-
Save colourgarden/fa80883b122877f4f5e2c991a890baf8 to your computer and use it in GitHub Desktop.
Flynt custom post type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# theme/config/customPostTypes/location/config.json | |
{ | |
"name": "location", | |
"label": "Locations", | |
"singular_label": "Location", | |
"description": "", | |
"public": true, | |
"show_ui": true, | |
"show_in_nav_menus": false, | |
"show_in_rest": false, | |
"labels": { | |
"menu_name": "Locations", | |
"all_items": "All Locations", | |
"add_new": "Add new Location" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# theme/config/templates/single-location.json | |
{ | |
"name": "DocumentDefault", | |
"areas": { | |
"layout": [ | |
{ | |
"name": "LayoutLocation", | |
"areas": { | |
"mainHeader": [ | |
{ | |
"name": "NavigationMain", | |
"customData": { | |
"menuSlug": "navigation_main" | |
} | |
} | |
], | |
"pageComponents": [ | |
{ | |
"name": "ComponentLoaderFlexible", | |
"customData": { | |
"fieldGroup": "locationComponents" | |
} | |
} | |
] | |
} | |
} | |
] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# theme/templates/single-location.php | |
<?php | |
Flynt\echoHtmlFromConfigFile('single-location.json'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment