Getting Started
What is Yano?
"Yano" is a filipino word means easy, so Yano is a tool for WordPress Theme Developer to develop theme using WordPress Customizer API while writing clean and minimal code only.
Why should use Yano?
Yano is developed to help WordPress Theme Developer to use WordPress Customizer API while writing minimal, maintainable code and also to avoid repetition of code.
Instructions
The first step is to include Yano in your wordpress theme project. There are two ways to install Yano in your wordpress theme project. The first option is to download Yano plugin version and install in your WordPress Plugin Directory. The second option is to download Yano library version and include in your theme. For more details about installation please read Installation Article.
The next step is to create a Panel and Section. After you create panel and section you can add Fields in section.
Example
After you install you can code in function.php
, here are the complete example of adding panel, section and field.
First is to add a Panel. For more information about panel arguments please read in here.
Yano::panel( 'panel_id', [
'title' => 'Panel title',
'description' => 'Panel description',
'priority' => 1
] );
Second is to add Section inside Panel. You need to copy the id
of Panel and copy in section argument panel
. For more information about section arguments please read here.
Yano::section( 'section_id', [
'title' => 'Section title',
'description' => 'Section description',
'priority' => 1,
'panel' => 'panel_id'
] );
And the last is to add a Field, we just need to copy the id
of the section and paste in field section
argument. In this example we will going to add a text field. For more information about text field your can read here.
Yano::field( 'text', [
'id' => 'textdb1',
'label' => 'Text Title',
'description' => 'Text Description',
'section' => 'section_id',
'priority' => 1,
'placeholder' => 'Write text'
] );