-
Notifications
You must be signed in to change notification settings - Fork 1
Development Workflow
Brian McCoy edited this page Feb 23, 2018
·
6 revisions
Alloy Core is great at providing the tools you need to integrate website designs into WordPress. It's usually best to turn the designs you're given into HTML/CSS first and then integrate them into your WordPress theme.
Let's say you're going to integrate the "About" page.
In your theme's root directory create a file called template-about.php and set up your class:
<?php
class Template_About extends Core_Template {
}
global $post;
new Template_About( $post->ID );In the views directory of your theme create a file called template-about.twig:
{% extends "base.twig" %}
{% block content %}
{% endblock %}In the app/custom-fields directory create a file called template-about.acf.php:
<?php
$group_args = [
'title' => 'About Page Options',
'location_is' => [ 'page_template', 'template-about.php' ],
'hide_on_screen' => [ 'the_content' ]
];
$fields = [
];
$field_group = core_register_field_group( 'about-acf', $group_args, $fields );Be sure to set your field group arguments and give core_register_field_group's first parameter a unique key.