add_section() public static méthode

Create a new section.
public static add_section ( string $id, array $args )
$id string The ID for this section.
$args array The section arguments.
Exemple #1
1
    /*******************************
     * FEATURED IMAGES
     ******************************/
    Kirki::add_section('featured_images', array('title' => __('Featured Images', 'daphnee'), 'priority' => 90));
    $post_types = array();
    $post_types_objects = get_post_types(array('public' => true, 'exclude_from_search' => false), 'objects', 'and');
    foreach ($post_types_objects as $post_type) {
        $post_types[$post_type->name] = $post_type->labels->name;
    }
    // Remove attachment post type
    $post_types = array_diff($post_types, array('attachment' => 'Media'));
    Kirki::add_field('daphnee', array('type' => 'multicheck', 'label' => __('Enable featured images per post-type', 'daphnee'), 'section' => 'featured_images', 'settings' => 'featured_image_post_types', 'description' => __('Please note that featured images will only be shown if the post type supports them and the post has a featured image.', 'daphnee'), 'default' => array('post'), 'choices' => $post_types));
    /*******************************
     * SOCIAL LINKS
     ******************************/
    Kirki::add_section('social_links', array('title' => __('Social Links', 'daphnee'), 'priority' => 100));
    Kirki::add_field('', array('label' => __('Social Links', 'kirki'), 'settings' => 'social_links', 'type' => 'repeater', 'section' => 'social_links', 'default' => array(), 'fields' => array('label' => array('type' => 'select', 'label' => 'Social Network', 'default' => '', 'choices' => array('' => __('choose one', 'daphnee'), 'twitter' => 'Twitter', 'facebook' => 'Facebook', 'google' => 'Google', 'pinterest' => 'Pinterest', 'foursquare' => 'Foursquare', 'yahoo' => 'Yahoo', 'skype' => 'Skype', 'yelp' => 'Yelp', 'feedburner' => 'Feedburner', 'linkedin' => 'LinkedIn', 'viadeo' => 'Viadeo', 'xing' => 'Xing', 'myspace' => 'Myspace', 'soundcloud' => 'Soundcloud', 'spotify' => 'Spotify', 'grooveshark' => 'Grooveshark', 'lastfm' => 'LastFM', 'youtube' => 'YouTube', 'vimeo' => 'Vimeo', 'dailymotion' => 'Dailymotion', 'vine' => 'Vine', 'flickr' => 'Flickr', '500px' => '500px', 'instagram' => 'Instagram', 'wordpress' => 'WordPress', 'tumblr' => 'Tumblr', 'blogger' => 'Blogger', 'technorati' => 'Technorati', 'reddit' => 'Reddit', 'dribbble' => 'Dribbble', 'stumbleupon' => 'StumbleUpon', 'digg' => 'Digg', 'envato' => 'Envato', 'behance' => 'Behance', 'delicious' => 'Delicious', 'deviantart' => 'Deviantart', 'forrst' => 'Forrst', 'playstore' => 'Playstore', 'zerply' => 'Zerply', 'wikipedia' => 'Wikipedia', 'apple' => 'Apple', 'flattr' => 'Flattr', 'github' => 'Github', 'chimein' => 'Chimein', 'friendfeed' => 'Friendfeed', 'newsvine' => 'Newsvine', 'identica' => 'Identica', 'bebo' => 'Bebo', 'zynga' => 'Zynga', 'steam' => 'Steam', 'xbox' => 'Xbox', 'windows' => 'Windows', 'outlook' => 'Outlook', 'coderwall' => 'Coderwall', 'tripadvisor' => 'Tripadvisor', 'appnet' => 'Appnet', 'goodreads' => 'Goodreads', 'tripit' => 'Tripit', 'lanyrd' => 'Lanyrd', 'slideshare' => 'Slideshare', 'buffer' => 'Buffer', 'rss' => 'RSS', 'vkontakte' => 'Vkontakte', 'disqus' => 'Disqus', 'houzz' => 'Houzz', 'mail' => 'Mail', 'patreon' => 'Patreon', 'paypal' => 'Paypal', 'playstation' => 'Playstation', 'smugmug' => 'Smugmug', 'swarm' => 'Swarm', 'triplej' => 'Triplej', 'yammer' => 'Yammer', 'stackoverflow' => 'Stackoverflow', 'drupal' => 'Drupal', 'odnoklassniki' => 'Odnoklassniki', 'android' => 'Android', 'meetup' => 'Meetup', 'persona' => 'Persona', 'amazon' => 'Amazon', 'ello' => 'Ello', 'mixcloud' => 'Mixcloud', '8tracks' => '8tracks', 'twitch' => 'Twitch', 'airbnb' => 'Airbnb')), 'link' => array('type' => 'text', 'label' => 'URL', 'default' => 'https://'))));
}
function daphnee_add_featured_image($content)
{
    global $post;
    $enabled_post_types = get_theme_mod('featured_image_post_types', array('post'));
    if (is_singular() && in_array($post->post_type, $enabled_post_types)) {
        $content = get_the_post_thumbnail($post->ID, 'full') . $content;
    }
    return $content;
}
add_filter('the_content', 'daphnee_add_featured_image');
function daphnee_add_plus_link()
{
    if (!Daphnee()->is_plus) {
 public function test_add_section()
 {
     Kirki::add_section('test_empty', array());
     Kirki::add_section('test', array('priority' => 4, 'title' => 'Title', 'description' => 'My Description', 'panel' => 'my_panel'));
     $this->assertEquals(array('id' => 'test_empty', 'description' => '', 'priority' => 10, 'active_callback' => '__return_true', 'panel' => ''), Kirki::$sections['test_empty']);
     $this->assertEquals(array('id' => 'test', 'title' => 'Title', 'description' => 'My Description', 'priority' => '4', 'active_callback' => '__return_true', 'panel' => 'my_panel'), Kirki::$sections['test']);
     $this->assertEquals(2, count(Kirki::$sections));
 }
Exemple #3
0
<?php

Kirki::add_section('theme_business_info', array('title' => __('Standardoplysninger'), 'description' => __('Tilføj standarderoplysninger på hjemmesiden.'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('smamo_business_info', array('settings' => 'info_name', 'label' => __('Firmanavn', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_address', 'label' => __('Adresse', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_post', 'label' => __('Postnummer', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_city', 'label' => __('By', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_cvr', 'label' => __('CVR', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_email', 'label' => __('Email', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_telefon', 'label' => __('Telefon', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_heading', 'label' => __('Hjemmesidens overskrift', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_subheading', 'label' => __('Hjemmesidens underoverskrift', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
function kirki_hooks_init()
{
    Kirki::add_config('my_kirki_repeater', array('capability' => 'edit_theme_options', 'option_type' => 'option', 'option_name' => 'my_kirki_repeater'));
    Kirki::add_section('my_kirki_repeater_section', array('title' => __('Kirki Repeater', 'kirki'), 'description' => __('Add custom CSS here', 'kirki'), 'panel' => '', 'priority' => 1, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
}
Exemple #5
0
<?php

if (class_exists('Kirki')) {
    Kirki::add_section('mailchimp', array('title' => __('Mailchimp'), 'description' => __('Tilføj API tilgang til mailchimp'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
    Kirki::add_field('mailchimp_api', array('settings' => 'mailchimp_api', 'label' => __('API nøgle', 'smamo'), 'section' => 'mailchimp', 'type' => 'text', 'priority' => 10, 'default' => '40bbbefd42e7b7fd5e22c5e0e9ca61b3-us10'));
    Kirki::add_field('list_ID', array('settings' => 'list_ID', 'label' => __('Liste ID', 'smamo'), 'section' => 'mailchimp', 'type' => 'text', 'priority' => 10, 'default' => '51f08ecfa7'));
}
Exemple #6
0
    /**
     * Add sections
     */
    $wp_customize->add_section('controls_with_choices', array('title' => __('Controls with Choices', 'kirki'), 'priority' => 10, 'description' => __('This is the section description', 'kirki')));
    $wp_customize->add_section('color_section', array('title' => __('Color Controls', 'kirki'), 'priority' => 10, 'description' => __('This is the section description', 'kirki')));
    $wp_customize->add_section('file_controls_section', array('title' => __('File & Image Controls', 'kirki'), 'priority' => 10, 'description' => __('This is the section description', 'kirki')));
    $wp_customize->add_section('text_section', array('title' => __('Text Control', 'kirki'), 'priority' => 10, 'description' => __('This is the section description', 'kirki')));
    $wp_customize->add_section('background_section', array('title' => __('Background Control', 'kirki'), 'priority' => 10, 'description' => __('This is the section description', 'kirki')));
    $wp_customize->add_section('numeric', array('title' => __('Numeric Controls', 'kirki'), 'priority' => 10, 'description' => __('This is the section description', 'kirki')));
    $wp_customize->add_section('custom_section', array('title' => __('Custom Control', 'kirki'), 'priority' => 10, 'description' => __('This is the section description', 'kirki')));
}
add_action('customize_register', 'kirki_demo_sections');
/**
 * Create panels using the Kirki API
 */
Kirki::add_section('boolean_controls', array('priority' => 10, 'title' => __('Boolean Controls', 'kirki'), 'description' => __('This panel contains controls that return true/false Controls', 'kirki')));
/**
 * Add controls using the 'kirki/fields' filter.
 */
function kirki_controls_with_choices_fields($fields)
{
    $fields[] = array('type' => 'radio', 'settings' => 'radio_demo', 'label' => __('Radio Control', 'kirki'), 'description' => __('This is the control description', 'kirki'), 'help' => __('This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'kirki'), 'section' => 'controls_with_choices', 'default' => 'option-1', 'priority' => 10, 'choices' => array('option-1' => __('Option 1', 'kirki'), 'option-2' => __('Option 2', 'kirki'), 'option-3' => __('Option 3', 'kirki'), 'option-4' => __('Option 4', 'kirki')));
    $fields[] = array('type' => 'dropdown-pages', 'settings' => 'dropdown_pages_demo', 'label' => __('Dropdown Pages', 'kirki'), 'description' => __('This is the control description', 'kirki'), 'help' => __('This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'kirki'), 'section' => 'controls_with_choices', 'priority' => 10);
    $fields[] = array('type' => 'select', 'settings' => 'select_demo', 'label' => __('Select', 'kirki'), 'description' => __('This is the control description', 'kirki'), 'help' => __('This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'kirki'), 'section' => 'controls_with_choices', 'default' => 'option-1', 'priority' => 10, 'choices' => array('option-1' => __('Option 1', 'kirki'), 'option-2' => __('Option 2', 'kirki'), 'option-3' => __('Option 3', 'kirki'), 'option-4' => __('Option 4', 'kirki')));
    $fields[] = array('type' => 'radio-image', 'settings' => 'radio_image_demo', 'label' => __('Radio-Image', 'kirki'), 'description' => __('This is the control description', 'kirki'), 'help' => __('This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'kirki'), 'section' => 'controls_with_choices', 'default' => 'option-1', 'priority' => 10, 'choices' => array('option-1' => admin_url() . '/images/align-left-2x.png', 'option-2' => admin_url() . '/images/align-center-2x.png', 'option-3' => admin_url() . '/images/align-right-2x.png'));
    $fields[] = array('type' => 'radio-buttonset', 'settings' => 'radio_buttonset_demo', 'label' => __('Radio-Buttonset', 'kirki'), 'description' => __('This is the control description', 'kirki'), 'help' => __('This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'kirki'), 'section' => 'controls_with_choices', 'default' => 'option-1', 'priority' => 10, 'choices' => array('option-1' => __('Option 1', 'kirki'), 'option-2' => __('Option 2', 'kirki'), 'option-3' => __('Option 3', 'kirki')));
    $fields[] = array('type' => 'multicheck', 'settings' => 'multicheck_demo', 'label' => __('Multicheck', 'kirki'), 'description' => __('This is the control description', 'kirki'), 'help' => __('This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'kirki'), 'section' => 'controls_with_choices', 'default' => array('option-1', 'option-2'), 'priority' => 10, 'choices' => array('option-1' => __('Option 1', 'kirki'), 'option-2' => __('Option 2', 'kirki'), 'option-3' => __('Option 3', 'kirki'), 'option-4' => __('Option 4', 'kirki')));
    $fields[] = array('type' => 'sortable', 'settings' => 'sortable_demo', 'label' => __('Sortable', 'kirki'), 'description' => __('This is the control description', 'kirki'), 'help' => __('This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'kirki'), 'section' => 'controls_with_choices', 'default' => array('option-3', 'option-1', 'option-4'), 'priority' => 10, 'choices' => array('option-1' => __('Option 1', 'kirki'), 'option-2' => __('Option 2', 'kirki'), 'option-3' => __('Option 3', 'kirki'), 'option-4' => __('Option 4', 'kirki'), 'option-5' => __('Option 5', 'kirki'), 'option-6' => __('Option 6', 'kirki')));
    // Define custom palettes
    $fields[] = array('type' => 'palette', 'settings' => 'palette_demo', 'label' => __('Palette', 'kirki'), 'description' => __('This is the control description', 'kirki'), 'help' => __('This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'kirki'), 'section' => 'controls_with_choices', 'default' => 'red', 'priority' => 10, 'choices' => array('red' => array('#ef9a9a', '#f44336', '#ff1744'), 'pink' => array('#fce4ec', '#f06292', '#e91e63', '#ad1457', '#f50057'), 'cyan' => array('#e0f7fa', '#80deea', '#26c6da', '#0097a7', '#00e5ff')));
    // Define custom palettes
Exemple #7
0
<?php

Kirki::add_section('theme_logo', array('title' => __('Logo'), 'description' => __('Vælg et logo til hjemmesiden'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('smamo_logo', array('settings' => 'logo', 'label' => __('Logo', 'smamo'), 'type' => 'image', 'section' => 'theme_logo', 'priority' => 10, 'default' => null));
Exemple #8
0
<?php

Kirki::add_section('footer', array('title' => __('Footer'), 'description' => __('Oplysninger, som vises i hjemmesidens Footer'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Skolenavn', 'fagy'), 'setting' => 'ft_school', 'section' => 'footer'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Adresselinje', 'fagy'), 'setting' => 'ft_address', 'section' => 'footer'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Postnummer og by', 'fagy'), 'setting' => 'ft_post_city', 'section' => 'footer'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Telefonnummer', 'fagy'), 'setting' => 'ft_phone', 'section' => 'footer'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Emailadresse', 'fagy'), 'setting' => 'ft_email', 'section' => 'footer'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('CVR - nummer', 'fagy'), 'setting' => 'ft_cvr', 'section' => 'footer'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('EAN - nummer', 'fagy'), 'setting' => 'ft_ean', 'section' => 'footer'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Skolenummer', 'fagy'), 'setting' => 'ft_school_no', 'section' => 'footer'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Eksamensnummer', 'fagy'), 'setting' => 'ft_exam_no', 'section' => 'footer'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Åbningstid', 'fagy'), 'setting' => 'ft_open', 'section' => 'footer'));
Exemple #9
0
<?php

Kirki::add_section('facebook', array('title' => __('Facebook App'), 'description' => __('Oplysninger, som bruges til at hente Nyheder og kalenderbegivenheder fra Facebook\'s API'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Facebook side', 'fagy'), 'setting' => 'facebook_page', 'section' => 'facebook'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Endpoint base', 'fagy'), 'description' => __('bruges som base for endpoints i kald til Facebooks api'), 'setting' => 'smamo_fb_api_base', 'section' => 'facebook'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('APP ID', 'fagy'), 'description' => __('Findes i indstillingerne for den App, du har oprettet.'), 'setting' => 'smamo_fb_app_id', 'section' => 'facebook'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('APP SECRET', 'fagy'), 'description' => __('Findes i indstillingerne for den App, du har oprettet.'), 'setting' => 'smamo_fb_app_secret', 'section' => 'facebook'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Redirect URI', 'fagy'), 'description' => __('Bruges til henvisning ved synkrone requests.'), 'setting' => 'smamo_fb_redirect_uri', 'section' => 'facebook'));
<?php

if (class_exists('Kirki')) {
    /**
     * Add config
     */
    Kirki::add_config('my_theme', array('capability' => 'edit_theme_options', 'option_type' => 'theme_mod'));
    /*
     * Add panel	
     */
    Kirki::add_panel('design', array('priority' => 10, 'title' => esc_attr__('Custom logo', 'twentysixteen-child-headerlogo')));
    /**
     * Add section
     */
    Kirki::add_section('logo', array('title' => esc_attr__('Replace site identity', 'twentysixteen-child-headerlogo'), 'priority' => 1, 'panel' => 'design', 'capability' => 'edit_theme_options'));
    /**
     * Add logo field
     */
    Kirki::add_field('my_theme', array('settings' => 'my_logo', 'label' => __('Choose your brand image', 'twentysixteen-child-headerlogo'), 'description' => __('Replace Twenty Sixteen site title and tagline with your custom logo', 'twentysixteen-child-headerlogo'), 'section' => 'logo', 'type' => 'upload', 'mime_type' => 'image', 'priority' => 10, 'default' => ''));
    /* Add SEO 'alt' tag on img element in DOM */
    Kirki::add_field('', array('type' => 'switch', 'settings' => 'logo_alt', 'label' => __('ALT tag?', 'twentysixteen-child-headerlogo'), 'description' => __('Add site tagline to logo ALT tag?', 'twentysixteen-child-headerlogo'), 'section' => 'logo', 'default' => '1', 'priority' => 20));
}
Exemple #11
0
 /**
  * Create the Section
  */
 public function create_section()
 {
     Kirki::add_section(sanitize_key($this->field['type']), array('priority' => 10, 'title' => sprintf(__('%s test', 'kirki'), $this->field['type'])));
 }
// Adding the Team Showcase panel
Kirki::add_panel('team_showcase', array('priority' => 10, 'title' => __('Team Showcase', 'magnificient'), 'description' => __('A section to show your team', 'magnificient')));
// Adding the Frontpage Separate Page Content panel
Kirki::add_panel('front_page_separate_page_content', array('priority' => 10, 'title' => __('Frontpage Separate Page Content', 'magnificient'), 'description' => __('A section to fetch content from another page', 'magnificient')));
// Adding the Product Slider for Homepage section
Kirki::add_section('product_slider_for_homepage', array('title' => __('Product Slider for Homepage', 'magnificient'), 'description' => __('This slider will be shown on the front page of your website', 'magnificient'), 'panel' => 'product_slider', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
// Adding the Product Images for Homepage section
Kirki::add_section('product_images_for_homepage', array('title' => __('Product Images for Homepage', 'magnificient'), 'description' => __('These images will be shown on the product description panels on the  front page of your website', 'magnificient'), 'panel' => 'product_description', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
// Adding the Product Description for Homepage section
Kirki::add_section('product_description_for_homepage', array('title' => __('Product Description for Homepage', 'magnificient'), 'description' => __('These panels will be shown on the front page of your website', 'magnificient'), 'panel' => 'product_description', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
// Adding the Product Details for Homepage section
Kirki::add_section('product_details_for_homepage', array('title' => __('Product Details for Homepage', 'magnificient'), 'description' => __('This will show the details on the front page of your website', 'magnificient'), 'panel' => 'product_details', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
// Adding the Team Showcase for Homepage section
Kirki::add_section('team_showcase_for_homepage', array('title' => __('Team Showcase for Homepage', 'magnificient'), 'description' => __('This will show the team members on the front page of your website', 'magnificient'), 'panel' => 'team_showcase', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
// Adding the Frontpage Separate Page Content for Homepage section
Kirki::add_section('front_page_separate_page_content_for_homepage', array('title' => __('Frontpage Separate Page Content for Homepage', 'magnificient'), 'description' => __('This will show the separate page content on the front page of your website', 'magnificient'), 'panel' => 'front_page_separate_page_content', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
// Adding the Product Slider image 1 field
Kirki::add_field('mc', array('type' => 'image', 'settings' => 'product_slider_image_1', 'label' => __('Product Slider image 1', 'magnificient'), 'description' => __('This image will be the first image for the Product Slider.', 'magnificient'), 'section' => 'product_slider_for_homepage', 'default' => '', 'priority' => 10));
// Adding the Product Slider image 2 field
Kirki::add_field('mc', array('type' => 'image', 'settings' => 'product_slider_image_2', 'label' => __('Product Slider image 2', 'magnificient'), 'description' => __('This image will be the second image for the Product Slider.', 'magnificient'), 'section' => 'product_slider_for_homepage', 'default' => '', 'priority' => 10));
// Adding the Product Slider image 3 field
Kirki::add_field('mc', array('type' => 'image', 'settings' => 'product_slider_image_3', 'label' => __('Product Slider image 3', 'magnificient'), 'description' => __('This image will be the third image for the Product Slider.', 'magnificient'), 'section' => 'product_slider_for_homepage', 'default' => '', 'priority' => 10));
// Adding the Product Slider image 4 field
Kirki::add_field('mc', array('type' => 'image', 'settings' => 'product_slider_image_4', 'label' => __('Product Slider image 4', 'magnificient'), 'description' => __('This image will be the fourth image for the Product Slider.', 'magnificient'), 'section' => 'product_slider_for_homepage', 'default' => '', 'priority' => 10));
// Adding the Product Slider image 5 field
Kirki::add_field('mc', array('type' => 'image', 'settings' => 'product_slider_image_5', 'label' => __('Product Slider image 5', 'magnificient'), 'description' => __('This image will be the fifth image for the Product Slider.', 'magnificient'), 'section' => 'product_slider_for_homepage', 'default' => '', 'priority' => 10));
// Adding the Product Slider caption 1 field
Kirki::add_field('mc', array('type' => 'text', 'settings' => 'product_slider_caption_1', 'label' => __('Product Slider caption 1', 'magnificient'), 'description' => __('This caption will be the description for the first slide.', 'magnificient'), 'section' => 'product_slider_for_homepage', 'default' => __('This is some default text', 'magnificient'), 'priority' => 10));
// Adding the Product Slider caption 2 field
Kirki::add_field('mc', array('type' => 'text', 'settings' => 'product_slider_caption_2', 'label' => __('Product Slider caption 2', 'magnificient'), 'description' => __('This caption will be the description for the second slide.', 'magnificient'), 'section' => 'product_slider_for_homepage', 'default' => __('This is some default text', 'magnificient'), 'priority' => 10));
// Adding the Product Slider caption 3 field
Exemple #13
0
    $wp_customize->get_control('site_icon')->priority = 20;
    $wp_customize->get_control('site_icon')->section = 'site_general';
}
add_action('customize_register', 'beagency_remove_customize_section', 1000);
// Early exit if Kirki is not installed
if (!class_exists('Kirki')) {
    return;
}
/**
 * Create panels using the Kirki API.
 */
Kirki::add_section('site_general', array('priority' => 10, 'title' => __('General', 'beagency'), 'description' => __('You may need to refresh the page to see the changes.', 'beagency')));
Kirki::add_section('site_homepage', array('priority' => 20, 'title' => __('Homepage', 'beagency'), 'description' => __('Here you can customize your homepage.', 'beagency'), 'active_callback' => 'is_front_page'));
Kirki::add_section('site_404_page', array('priority' => 30, 'title' => __('404 Page', 'beagency'), 'description' => __('Here you can customize your 404 Page.', 'beagency'), 'active_callback' => 'is_404'));
Kirki::add_section('site_footer', array('priority' => 120, 'title' => __('Site Footer', 'beagency'), 'description' => __('Here you can customize the footer on your site.', 'beagency')));
Kirki::add_section('upgrade_theme', array('priority' => 130, 'title' => __('Upgrade', 'beagency')));
/**
 * Create a config instance that will be used by fields added via the static methods.
 */
Kirki::add_config('beagency_kirki', array('option_type' => 'theme_mod'));
/**
 * Create fields using the Kirki API static functions.
 */
Kirki::add_field('beagency_kirki', array('type' => 'text', 'settings' => 'general_site_title', 'label' => __('Site Title', 'beagency'), 'section' => 'site_general', 'default' => get_bloginfo('name'), 'priority' => 10, 'transport' => 'postMessage', 'js_vars' => array(array('element' => '.site-title a', 'function' => 'html', 'property' => 'text'))));
Kirki::add_field('beagency_kirki', array('type' => 'dropdown-pages', 'settings' => 'general_front_page', 'label' => __('Front Page', 'beagency'), 'help' => __('Create a blank page with Home Page template and set it as Front Page.', 'beagency'), 'section' => 'site_general', 'default' => get_option('page_on_front'), 'priority' => 20));
Kirki::add_field('beagency_kirki', array('type' => 'dropdown-pages', 'settings' => 'general_posts_page', 'label' => __('Posts Page', 'beagency'), 'help' => __('Create a blank page and set it as Posts Page.', 'beagency'), 'section' => 'site_general', 'default' => get_option('page_for_posts'), 'priority' => 30));
Kirki::add_field('beagency_kirki', array('type' => 'checkbox', 'settings' => 'general_sticky_menu', 'label' => __('Enable Sticky Menu?', 'beagency'), 'help' => __('If enable, the menu will be accessible from anywhere without having to scroll.', 'beagency'), 'section' => 'site_general', 'default' => '1', 'priority' => 40));
Kirki::add_field('beagency_kirki', array('type' => 'checkbox', 'settings' => 'general_go_to_top', 'label' => __('Enable Go to Top Button?', 'beagency'), 'section' => 'site_general', 'default' => '1', 'priority' => 50));
Kirki::add_field('beagency_kirki', array('type' => 'checkbox', 'settings' => 'homepage_heading', 'label' => __('Enable Heading Block?', 'beagency'), 'section' => 'site_homepage', 'default' => '1', 'priority' => 10));
Kirki::add_field('beagency_kirki', array('type' => 'textarea', 'settings' => 'homepage_heading_h1', 'label' => __('Heading', 'beagency'), 'help' => __('If you want to color the word, just wrap it with \\"span\\" tag.', 'beagency'), 'section' => 'site_homepage', 'default' => 'Hello, We are <span>BeTheme</span>. We <span><i class="fa fa-heart-o"></i></span> WordPress!', 'priority' => 20, 'required' => array(array('setting' => 'homepage_heading', 'operator' => '==', 'value' => 1))));
Kirki::add_field('beagency_kirki', array('type' => 'textarea', 'settings' => 'homepage_heading_span', 'label' => __('Content', 'beagency'), 'section' => 'site_homepage', 'default' => 'We handcraft well-thought-out WordPress themes built on solid coding and elegant design.', 'priority' => 30, 'required' => array(array('setting' => 'homepage_heading', 'operator' => '==', 'value' => 1))));
 Kirki::add_section('topbar_color_settings', array('title' => __('Topbar Colors', 'lathom'), 'description' => __('Configure Color Settings for the Topbar', 'lathom'), 'panel' => 'topbar', 'priority' => 20, 'capability' => 'edit_theme_options'));
 // Kirki::add_panel( 'menue', array(
 //     'priority'    => 210,
 //     'title'       => __( 'Offcanvas Menu Configuration', 'lathom' ),
 //     'description' => __( '', 'lathom' ),
 // ) );
 Kirki::add_section('menu_settings', array('title' => __('Offcanvas Menu Settings', 'lathom'), 'description' => __('', 'lathom'), 'panel' => '', 'priority' => 220, 'capability' => 'edit_theme_options'));
 Kirki::add_panel('content', array('priority' => 230, 'title' => __('Content Settings', 'lathom'), 'description' => __('My Description', 'lathom')));
 Kirki::add_section('content_features', array('title' => __('Content Features', 'lathom'), 'description' => __('', 'lathom'), 'panel' => 'content', 'priority' => 10, 'capability' => 'edit_theme_options'));
 Kirki::add_section('article_features', array('title' => __('Article Features', 'lathom'), 'description' => __('', 'lathom'), 'panel' => 'content', 'priority' => 15, 'capability' => 'edit_theme_options'));
 Kirki::add_section('article_colors', array('title' => __('Article Colors', 'lathom'), 'description' => __('', 'lathom'), 'panel' => 'content', 'priority' => 20, 'capability' => 'edit_theme_options'));
 Kirki::add_section('sidebar_colors', array('title' => __('Sidebar Configuration', 'lathom'), 'description' => __('Configure Sidebar Settings', 'lathom'), 'panel' => 'content', 'priority' => 30, 'capability' => 'edit_theme_options'));
 Kirki::add_panel('footer', array('priority' => 260, 'title' => __('Footer Configuration', 'lathom'), 'description' => __('', 'lathom')));
 Kirki::add_section('footerwidgets_settings', array('title' => __('Footer Widgets Settings', 'lathom'), 'description' => __('Configure Settings for the Footer Widgets Area', 'lathom'), 'panel' => 'footer', 'priority' => 10, 'capability' => 'edit_theme_options'));
 Kirki::add_section('footer_settings', array('title' => __('Footer Settings', 'lathom'), 'description' => __('Configure Settings for the Footer', 'lathom'), 'panel' => 'footer', 'priority' => 10, 'capability' => 'edit_theme_options'));
 Kirki::add_section('custom_code', array('title' => __('Custom Code', 'lathom'), 'description' => __('You can inject your own CSS and Javascript without modifying any of the theme files.', 'lathom'), 'panel' => '', 'priority' => 270, 'capability' => 'edit_theme_options'));
 /**
  * Add the configuration.
  * This way all the fields using the 'lathom' ID
  * will inherit these options
  */
 Kirki::add_config('lathom', array('capability' => 'edit_theme_options', 'option_type' => 'theme_mod'));
 /**
  * Font Settings
  */
 Kirki::add_field('base_typography', array('type' => 'typography', 'settings' => 'base_typography_config', 'label' => esc_attr__('Base Typography', 'lathom'), 'description' => esc_attr__('Configures the overall Font for the whole Site.', 'lathom'), 'help' => esc_attr__('', 'lathom'), 'section' => 'typography', 'default' => array('font-style' => array('bold', 'italic'), 'font-family' => 'Open Sans', 'font-size' => '16', 'font-weight' => '400', 'line-height' => '1.5', 'letter-spacing' => '-0.004', 'word-spacing' => '0.125'), 'priority' => 10, 'choices' => array('font-style' => true, 'font-family' => true, 'font-size' => true, 'font-weight' => true, 'line-height' => true, 'letter-spacing' => true, 'word-spacing' => true, 'units' => array('px', 'rem')), 'output' => array(array('element' => 'body'))));
 Kirki::add_field('headline_typography', array('type' => 'typography', 'settings' => 'headline_typography_config', 'label' => esc_attr__('Headline Typography', 'lathom'), 'description' => esc_attr__('Configures Headline Fonts for the Site.', 'lathom'), 'help' => esc_attr__('', 'lathom'), 'section' => 'typography', 'default' => array('font-style' => array('bold'), 'font-family' => 'Titillium Web', 'font-weight' => '800', 'letter-spacing' => '0.125', 'word-spacing' => '0.125'), 'priority' => 10, 'choices' => array('font-style' => true, 'font-family' => true, 'font-weight' => true, 'letter-spacing' => true, 'word-spacing' => true, 'units' => array('px', 'rem')), 'output' => array(array('element' => 'h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6'))));
 /**
  * Topbar text settings
  */
 Kirki::add_field('lathom', array('type' => 'switch', 'settings' => 'display_brand_image', 'label' => __('Display Brand Image?', 'lathom'), 'description' => __('', 'lathom'), 'help' => __('', 'lathom'), 'section' => 'topbar_features', 'default' => '1', 'priority' => 10));
Exemple #15
0
<?php

if (class_exists('Kirki')) {
    Kirki::add_section('site_info', array('title' => __('Information'), 'description' => __('Tilføj generel info, som bruges på hele hjemmesiden'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
    Kirki::add_field('info_long_description', array('settings' => 'info_long_description', 'label' => __('Lang beskrivelse', 'smamo'), 'section' => 'site_info', 'type' => 'editor', 'priority' => 10, 'default' => ''));
    Kirki::add_field('info_name', array('settings' => 'info_name', 'label' => __('Navn', 'smamo'), 'section' => 'site_info', 'type' => 'text', 'priority' => 10, 'default' => ''));
    Kirki::add_field('info_address', array('settings' => 'info_address', 'label' => __('Adresse', 'smamo'), 'section' => 'site_info', 'type' => 'text', 'priority' => 10, 'default' => ''));
    Kirki::add_field('info_post', array('settings' => 'info_post', 'label' => __('Postnummer', 'smamo'), 'section' => 'site_info', 'type' => 'text', 'priority' => 10, 'default' => ''));
    Kirki::add_field('info_by', array('settings' => 'info_by', 'label' => __('By', 'smamo'), 'section' => 'site_info', 'type' => 'text', 'priority' => 10, 'default' => ''));
    Kirki::add_field('info_email', array('settings' => 'info_email', 'label' => __('Email', 'smamo'), 'section' => 'site_info', 'type' => 'text', 'priority' => 10, 'default' => ''));
    Kirki::add_field('info_telefon', array('settings' => 'info_telefon', 'label' => __('Telefon', 'smamo'), 'section' => 'site_info', 'type' => 'text', 'priority' => 10, 'default' => ''));
}
<?php

Kirki::add_section('theme_business_info', array('title' => __('Firmaoplysninger'), 'description' => __('Tilføj oplysninger på firma, som hjemmesiden skal repræsentere.'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('smamo_business_info', array('settings' => 'info_name', 'label' => __('Firmanavn', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_address', 'label' => __('Adresse', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_post', 'label' => __('Postnummer', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_city', 'label' => __('By', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_cvr', 'label' => __('CVR', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_email', 'label' => __('Email', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_telefon', 'label' => __('Telefon', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Exemple #17
0
Kirki::add_section('post_layout', array('title' => __('Layout', 'infinity'), 'description' => __('In this section you can control all layout settings of posts', 'infinity'), 'panel' => 'post', 'priority' => $priority++));
Kirki::add_section('post_style', array('title' => __('Style', 'infinity'), 'description' => __('In this section you can control all style settings of posts', 'infinity'), 'panel' => 'post', 'priority' => $priority++));
Kirki::add_section('post_spacing', array('title' => __('Spacing', 'infinity'), 'description' => __('In this section you can control all spacing settings of posts', 'infinity'), 'panel' => 'post', 'priority' => $priority++));
Kirki::add_section('post_border', array('title' => __('Border', 'infinity'), 'description' => __('In this section you can control all border settings of posts', 'infinity'), 'panel' => 'post', 'priority' => $priority++));
Kirki::add_section('post_bg', array('title' => __('Background', 'infinity'), 'description' => __('In this section you can control all background settings of posts', 'infinity'), 'panel' => 'post', 'priority' => $priority++));
$priority = 1;
// Add sections for woo panel
Kirki::add_section('woo_layout', array('title' => __('Layout', 'infinity'), 'description' => __('In this section you can control all layout settings of woocommerce', 'infinity'), 'panel' => 'woo', 'priority' => $priority++));
Kirki::add_section('woo_color', array('title' => __('Color', 'infinity'), 'description' => __('In this section you can control all color settings of woocommerce', 'infinity'), 'panel' => 'woo', 'priority' => $priority++));
Kirki::add_section('woo_spacing', array('title' => __('Spacing', 'infinity'), 'description' => __('In this section you can control all spacing settings of woocommerce', 'infinity'), 'panel' => 'woo', 'priority' => $priority++));
Kirki::add_section('woo_border', array('title' => __('Border', 'infinity'), 'description' => __('In this section you can control all border settings of woocommerce', 'infinity'), 'panel' => 'woo', 'priority' => $priority++));
Kirki::add_section('woo_bg', array('title' => __('Background', 'infinity'), 'description' => __('In this section you can control all background settings of woocommerce', 'infinity'), 'panel' => 'woo', 'priority' => $priority++));
$priority = 1;
// Add sections for custom code panel
Kirki::add_section('custom_css', array('title' => __('Custom CSS', 'infinity'), 'description' => __('In this section you can control custom css', 'infinity'), 'panel' => 'custom', 'priority' => $priority++));
Kirki::add_section('custom_js', array('title' => __('Custom JS', 'infinity'), 'description' => __('In this section you can control custom javascript', 'infinity'), 'panel' => 'custom', 'priority' => $priority++));
/**
 * Include setups
 * ==============
 */
//site
locate_template('/inc/customizer/setups/site-general.php', true, true);
locate_template('/inc/customizer/setups/site-layouts.php', true, true);
locate_template('/inc/customizer/setups/site-logo.php', true, true);
locate_template('/inc/customizer/setups/site-favicon.php', true, true);
locate_template('/inc/customizer/setups/site-color.php', true, true);
locate_template('/inc/customizer/setups/site-style.php', true, true);
locate_template('/inc/customizer/setups/site-bg.php', true, true);
//nav
locate_template('/inc/customizer/setups/nav-layout.php', true, true);
locate_template('/inc/customizer/setups/nav-style.php', true, true);
Exemple #18
0
<?php

/* Create Kirki Configuration */
function aptnews_kirki_configuration()
{
    return array('url_path' => get_stylesheet_directory_uri() . '/inc/kirki/');
}
add_filter('kirki/config', 'aptnews_kirki_configuration');
/* Turn off sanitization for input */
function do_not_filter_anything($value)
{
    return $value;
}
Kirki::add_config('my_config', array('option_type' => 'theme_mod', 'capability' => 'edit_theme_options'));
// Panel & Section & Field
Kirki::add_panel('frontpage_leftbar_panel', array('priority' => 10, 'title' => __('Home - Left Bar', 'aptnews'), 'description' => __('Customize left bar', 'aptnews')));
Kirki::add_section('frontpage_leftbar_tags_section', array('title' => __('Tags', 'aptnews'), 'panel' => 'frontpage_leftbar_panel', 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('my_config', array('type' => 'text', 'settings' => 'frontpage_leftbar_tags_field', 'label' => __('Tags', 'aptnews'), 'description' => __('show most popular by given', 'aptnews'), 'section' => 'frontpage_leftbar_tags_section'));
Exemple #19
0
<?php

Kirki::add_section('mailchimp', array('title' => __('Mailchimp'), 'description' => __('Instillinger for integration med Mailchimp'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('mailchimp', array('settings' => 'mailchimp_activate', 'label' => __('Aktiver mailchimp panel og widgets', 'smamo'), 'section' => 'mailchimp', 'type' => 'checkbox', 'priority' => 10, 'default' => '0'));
Kirki::add_field('mailchimp', array('settings' => 'mailchimp_title', 'label' => __('Paneloverskrift', 'smamo'), 'section' => 'mailchimp', 'type' => 'text', 'priority' => 10, 'default' => null));
Kirki::add_field('mailchimp', array('settings' => 'mailchimp_description', 'label' => __('Paneltekst', 'smamo'), 'section' => 'mailchimp', 'type' => 'textarea', 'priority' => 10, 'default' => null));
Kirki::add_field('mailchimp', array('settings' => 'mailchimp_api_key', 'label' => __('API nøgle', 'smamo'), 'section' => 'mailchimp', 'type' => 'text', 'priority' => 10, 'default' => null));
Kirki::add_field('mailchimp', array('settings' => 'mailchimp_list_id', 'label' => __('Liste ID', 'smamo'), 'section' => 'mailchimp', 'type' => 'text', 'priority' => 10, 'default' => null));
Exemple #20
0
Kirki::add_section('typography_footer', array('priority' => 50, 'title' => __('Footer', 'flatbook'), 'capability' => 'edit_theme_options', 'panel' => 'panel_typography'));
Kirki::add_section('typography_headings', array('priority' => 60, 'title' => __('Headings', 'flatbook'), 'capability' => 'edit_theme_options', 'panel' => 'panel_typography'));
Kirki::add_section('typography_quotes', array('priority' => 70, 'title' => __('Blockquotes', 'flatbook'), 'capability' => 'edit_theme_options', 'panel' => 'panel_typography'));
Kirki::add_section('typography_buttons', array('priority' => 80, 'title' => __('Buttons', 'flatbook'), 'capability' => 'edit_theme_options', 'panel' => 'panel_typography'));
/**
 *	COLORS
 */
Kirki::add_section('colors_global', array('priority' => 10, 'title' => __('Global', 'flatbook'), 'capability' => 'edit_theme_options', 'panel' => 'panel_colors'));
Kirki::add_section('colors_header', array('priority' => 20, 'title' => __('Header', 'flatbook'), 'capability' => 'edit_theme_options', 'panel' => 'panel_colors'));
Kirki::add_section('colors_navbar', array('priority' => 30, 'title' => __('Navbar', 'flatbook'), 'capability' => 'edit_theme_options', 'panel' => 'panel_colors'));
Kirki::add_section('colors_footer', array('priority' => 40, 'title' => __('Footer', 'flatbook'), 'capability' => 'edit_theme_options', 'panel' => 'panel_colors'));
Kirki::add_section('colors_headings', array('priority' => 50, 'title' => __('Headings', 'flatbook'), 'capability' => 'edit_theme_options', 'panel' => 'panel_colors'));
/**
 *	LAYOUT
 */
Kirki::add_section('layout_global', array('priority' => 10, 'title' => __('Global', 'flatbook'), 'capability' => 'edit_theme_options', 'panel' => 'panel_layout'));
Kirki::add_section('layout_header', array('priority' => 20, 'title' => __('Header', 'flatbook'), 'capability' => 'edit_theme_options', 'panel' => 'panel_layout'));
Kirki::add_section('layout_navbar', array('priority' => 30, 'title' => __('Navbar', 'flatbook'), 'capability' => 'edit_theme_options', 'panel' => 'panel_layout'));
Kirki::add_section('layout_content', array('priority' => 40, 'title' => __('Content', 'flatbook'), 'capability' => 'edit_theme_options', 'panel' => 'panel_layout'));
Kirki::add_section('layout_footer', array('priority' => 50, 'title' => __('Footer', 'flatbook'), 'capability' => 'edit_theme_options', 'panel' => 'panel_layout'));
/**
 *	PAGES
 */
Kirki::add_section('blog_page', array('priority' => 10, 'title' => __('Blog (Posts Page)', 'flatbook'), 'capability' => 'edit_theme_options', 'panel' => 'panel_pages'));
Kirki::add_section('blog_single', array('priority' => 20, 'title' => __('Single Post', 'flatbook'), 'capability' => 'edit_theme_options', 'panel' => 'panel_pages'));
Kirki::add_section('error_page', array('priority' => 30, 'title' => __('404 Error', 'flatbook'), 'capability' => 'edit_theme_options', 'panel' => 'panel_pages'));
/**
 *  CUSTOM CSS
 */
Kirki::add_section('custom_css', array('priority' => 200, 'title' => __('Custom Css', 'flatbook'), 'capability' => 'edit_theme_options'));
Kirki::add_field('fb', array('type' => 'code', 'settings' => 'custom_css_code', 'label' => __('Custom Css', 'flatbook'), 'description' => __('Add your additional custom Css rules below. Note that these rules will overwrite the default theme styles.', 'flatbook'), 'section' => 'custom_css', 'default' => '', 'priority' => 10, 'choices' => array('language' => 'css', 'theme' => 'eclipse', 'height' => 500)));
Exemple #21
0
 public function add_section()
 {
     Kirki::add_section('section_id', array('title' => 'My Title', 'description' => 'My Description', 'panel' => 'panel_id', 'priority' => 160, 'capability' => 'edit_theme_options'));
 }
Exemple #22
0
function gannet_kirki_init()
{
    Kirki::add_config('gannet_config', array('capability' => 'edit_theme_options', 'option_type' => 'theme_mod'));
    /**
     * Header Panel
     * - Header Image
     * - Header Logo
     */
    /**
     * Header Text or Logo
     */
    Kirki::add_field('gannet_config', array('type' => 'radio-buttonset', 'settings' => 'header_brand', 'label' => __('Show Header Text or Logo', 'gannet'), 'description' => __('Enable search functionality', 'gannet'), 'section' => 'title_tagline', 'priority' => 10, 'default' => 'text', 'choices' => array('text' => __('Header Text', 'gannet'), 'logo' => __('Logo', 'gannet'))));
    /**
     * Site Title Color
     */
    Kirki::add_field('gannet_config', array('type' => 'color', 'label' => __('Site Title Color', 'gannet'), 'settings' => 'site_title_color', 'section' => 'title_tagline', 'default' => '#292929', 'priority' => 10, 'required' => array(array('setting' => 'header_brand', 'operator' => '==', 'value' => 'text')), 'output' => array(array('element' => '.site-title a', 'property' => 'color')), 'transport' => 'postMessage', 'js_vars' => array(array('element' => '.site-title a', 'function' => 'css', 'property' => 'color'))));
    /**
     * Site Tagline Color
     */
    Kirki::add_field('gannet_config', array('type' => 'color', 'label' => __('Site Tagline Color', 'gannet'), 'settings' => 'site_tagline_color', 'section' => 'title_tagline', 'default' => '#7cccf9', 'priority' => 10, 'required' => array(array('setting' => 'header_brand', 'operator' => '==', 'value' => 'text')), 'output' => array(array('element' => '.site-description', 'property' => 'color')), 'transport' => 'postMessage', 'js_vars' => array(array('element' => '.site-description', 'function' => 'css', 'property' => 'color'))));
    Kirki::add_field('gannet_config', array('type' => 'select', 'settings' => 'site_title_font_family', 'label' => __('Site title Font Family', 'gannet'), 'section' => 'title_tagline', 'default' => 'Roboto Condensed', 'priority' => 20, 'choices' => Kirki_Fonts::get_font_choices(), 'required' => array(array('setting' => 'header_brand', 'operator' => '==', 'value' => 'text')), 'output' => array(array('element' => '.site-branding .site-title a', 'property' => 'font-family')), 'transport' => 'postMessage', 'js_vars' => array(array('element' => '.site-branding .site-title a', 'function' => 'css', 'property' => 'font-family'))));
    Kirki::add_field('gannet_config', array('type' => 'select', 'settings' => 'site_description_font_family', 'label' => __('Site Description Font Family', 'gannet'), 'section' => 'title_tagline', 'default' => 'Droid Serif', 'priority' => 20, 'choices' => Kirki_Fonts::get_font_choices(), 'required' => array(array('setting' => 'header_brand', 'operator' => '==', 'value' => 'text')), 'output' => array(array('element' => '.site-branding .site-description', 'property' => 'font-family')), 'transport' => 'postMessage', 'js_vars' => array(array('element' => '.site-branding .site-description', 'function' => 'css', 'property' => 'font-family'))));
    Kirki::add_field('gannet_config', array('settings' => 'logo', 'label' => __('Upload Your Logo', 'gannet'), 'description' => __('We recommend a maximum logo size of 260 x 80 pixels', 'gannet'), 'section' => 'title_tagline', 'priority' => 20, 'type' => 'upload', 'required' => array(array('setting' => 'header_brand', 'operator' => '==', 'value' => 'logo'))));
    Kirki::add_field('gannet_config', array('settings' => 'logo_retina', 'label' => __('Upload Your Retina Logo', 'gannet'), 'description' => __('The retina logo must be double the main logo resolution, so at our recommendation it would be 520 x 160 pixels', 'gannet'), 'section' => 'title_tagline', 'priority' => 20, 'type' => 'upload', 'required' => array(array('setting' => 'header_brand', 'operator' => '==', 'value' => 'logo'))));
    /**
     * Colors Panel
     * - Skin (Premium)
     * - Palettes (premium)
     * - Background Color
     * - Primary Color
     * - Secondary Color
     * - Headings Text Color
     * - Body Text Color
     */
    Kirki::add_field('gannet_config', array('type' => 'custom', 'label' => __('Skin', 'gannet'), 'description' => __('Choose between light or dark skins.', 'gannet'), 'settings' => 'skin_upsell', 'section' => 'colors', 'default' => gannet_upsell(__('This feature is only available in the premium version', 'gannet'))));
    Kirki::add_field('gannet_config', array('type' => 'custom', 'label' => __('Palettes', 'gannet'), 'description' => __('Choose between a set of carefully crafted pallettes.', 'gannet'), 'settings' => 'palettes_upsell', 'section' => 'colors', 'default' => gannet_upsell(__('This feature is only available in the premium version', 'gannet'))));
    /**
     * Background Color
     */
    Kirki::add_field('gannet_config', array('type' => 'color', 'label' => __('Background Color', 'gannet'), 'description' => __('Choose a background accent color.', 'gannet'), 'settings' => 'background_color', 'section' => 'colors', 'default' => '#f9f9f9', 'transport' => 'postMessage', 'js_vars' => array(array('element' => 'body', 'function' => 'css', 'property' => 'background-color'))));
    /**
     * Primary Color
     */
    Kirki::add_field('gannet_config', array('type' => 'color', 'label' => __('Primary Color', 'gannet'), 'description' => __('Choose a primary accent color.', 'gannet'), 'settings' => 'primary_color', 'section' => 'colors', 'default' => '#7bcaf7', 'transport' => 'postMessage', 'js_vars' => array(array('element' => 'a, .site-branding .site-description', 'function' => 'css', 'property' => 'color'))));
    /**
     * Secondary Color
     */
    Kirki::add_field('gannet_config', array('type' => 'color', 'label' => __('Secondary Color', 'gannet'), 'description' => __('Choose a secondary accent color.', 'gannet'), 'settings' => 'secondary_color', 'section' => 'colors', 'default' => '#f0b86f'));
    Kirki::add_field('gannet_config', array('type' => 'color', 'label' => __('Heading Text Color', 'gannet'), 'description' => __('Choose a heading (h1 - h6) color.', 'gannet'), 'settings' => 'heading_text_color', 'section' => 'colors', 'default' => '#292929', 'js_vars' => array(array('element' => 'h1, h2, h3, h4, h5, h6', 'function' => 'css', 'property' => 'color'))));
    Kirki::add_field('gannet_config', array('type' => 'color', 'label' => __('Body Text Color', 'gannet'), 'description' => __('Choose a body text color.', 'gannet'), 'settings' => 'body_text_color', 'section' => 'colors', 'default' => '#292929', 'js_vars' => array(array('element' => 'body', 'function' => 'css', 'property' => 'color'))));
    /**
     * Layout Section
     */
    Kirki::add_section('layout', array('priority' => 90, 'title' => __('Layout & Design', 'gannet')));
    Kirki::add_field('gannet_config', array('type' => 'custom', 'label' => __('Site Layout', 'gannet'), 'settings' => 'site_layout_upsell', 'section' => 'layout', 'default' => gannet_upsell(__('This feature is only available in the premium version', 'gannet'))));
    Kirki::add_field('gannet_config', array('type' => 'custom', 'label' => __('Header Layout', 'gannet'), 'settings' => 'header_layout_upsell', 'section' => 'layout', 'default' => gannet_upsell(__('This feature is only available in the premium version', 'gannet'))));
    Kirki::add_field('gannet_config', array('type' => 'switch', 'settings' => 'show_search', 'label' => __('Show Search', 'gannet'), 'description' => __('Enable search functionality', 'gannet'), 'help' => __('Displays/removes search icon in navigation and footer.', 'gannet'), 'section' => 'layout', 'priority' => 20, 'default' => '1', 'choices' => array('on' => __('On', 'gannet'), 'off' => __('Off', 'gannet'))));
    /**
     * Typography
     */
    Kirki::add_panel('typography_panel', array('priority' => 90, 'title' => __('Typography', 'gannet')));
    /**
     * Heading Type
     */
    Kirki::add_section('heading_type', array('title' => __('Headings', 'gannet'), 'panel' => 'typography_panel'));
    Kirki::add_field('gannet_config', array('type' => 'select', 'settings' => 'heading_type_font_family', 'label' => __('Font Family', 'gannet'), 'section' => 'heading_type', 'default' => 'Open Sans', 'priority' => 20, 'choices' => Kirki_Fonts::get_font_choices(), 'output' => array(array('element' => 'h1, h2, h3, h4, h5, h6', 'property' => 'font-family')), 'transport' => 'postMessage', 'js_vars' => array(array('element' => 'h1, h2, h3, h4, h5, h6', 'function' => 'css', 'property' => 'font-family'))));
    Kirki::add_field('gannet_config', array('type' => 'slider', 'settings' => 'heading_type_font_weight', 'label' => __('Font Weight', 'gannet'), 'section' => 'heading_type', 'default' => 600, 'priority' => 24, 'choices' => array('min' => 100, 'max' => 900, 'step' => 100), 'transport' => 'postMessage', 'js_vars' => array(array('element' => 'h1, h2, h3, h4, h5, h6', 'function' => 'css', 'property' => 'font-weight'))));
    /**
     * H1 Font Size
     */
    Kirki::add_field('gannet_config', array('type' => 'slider', 'settings' => 'heading_type_h1_font_size', 'label' => __('H1 Font Size', 'gannet'), 'section' => 'heading_type', 'default' => 40, 'priority' => 25, 'choices' => array('min' => 22, 'max' => 60, 'step' => 1), 'transport' => 'postMessage', 'js_vars' => array(array('element' => 'h1', 'function' => 'css', 'property' => 'font-size', 'units' => 'px'))));
    /**
     * H2 Font Size
     */
    Kirki::add_field('gannet_config', array('type' => 'slider', 'settings' => 'heading_type_h2_font_size', 'label' => __('H2 Font Size', 'gannet'), 'section' => 'heading_type', 'default' => 34, 'priority' => 25, 'choices' => array('min' => 20, 'max' => 50, 'step' => 1), 'transport' => 'postMessage', 'js_vars' => array(array('element' => 'h2', 'function' => 'css', 'property' => 'font-size', 'units' => 'px'))));
    /**
     * H3 Font Size
     */
    Kirki::add_field('gannet_config', array('type' => 'slider', 'settings' => 'heading_type_h3_font_size', 'label' => __('H3 Font Size', 'gannet'), 'section' => 'heading_type', 'default' => 24, 'priority' => 25, 'choices' => array('min' => 26, 'max' => 48, 'step' => 1), 'transport' => 'postMessage', 'js_vars' => array(array('element' => 'h3', 'function' => 'css', 'property' => 'font-size', 'units' => 'px'))));
    /**
     * H4 Font Size
     */
    Kirki::add_field('gannet_config', array('type' => 'slider', 'settings' => 'heading_type_h4_font_size', 'label' => __('H4 Font Size', 'gannet'), 'section' => 'heading_type', 'default' => 22, 'priority' => 25, 'choices' => array('min' => 16, 'max' => 40, 'step' => 1), 'transport' => 'postMessage', 'js_vars' => array(array('element' => 'h4', 'function' => 'css', 'property' => 'font-size', 'units' => 'px'))));
    /**
     * H5 Font Size
     */
    Kirki::add_field('gannet_config', array('type' => 'slider', 'settings' => 'heading_type_h5_font_size', 'label' => __('H5 Font Size', 'gannet'), 'section' => 'heading_type', 'default' => 20, 'priority' => 25, 'choices' => array('min' => 14, 'max' => 40, 'step' => 1), 'transport' => 'postMessage', 'js_vars' => array(array('element' => 'h5', 'function' => 'css', 'property' => 'font-size', 'units' => 'px'))));
    /**
     * H6 Font Size
     */
    Kirki::add_field('gannet_config', array('type' => 'slider', 'settings' => 'heading_type_h6_font_size', 'label' => __('H6 Font Size', 'gannet'), 'section' => 'heading_type', 'default' => 18, 'priority' => 25, 'choices' => array('min' => 12, 'max' => 30, 'step' => 1), 'transport' => 'postMessage', 'js_vars' => array(array('element' => 'h6', 'function' => 'css', 'property' => 'font-size', 'units' => 'px'))));
    /**
     * Base Typography
     */
    Kirki::add_section('base_type', array('title' => __('Base', 'gannet'), 'panel' => 'typography_panel'));
    Kirki::add_field('gannet_config', array('type' => 'select', 'settings' => 'base_type_font_family', 'label' => __('Font Family', 'gannet'), 'section' => 'base_type', 'default' => 'Open Sans', 'priority' => 20, 'choices' => Kirki_Fonts::get_font_choices(), 'transport' => 'postMessage', 'output' => array(array('element' => 'body', 'property' => 'font-family')), 'js_vars' => array(array('element' => 'body', 'function' => 'css', 'property' => 'font-family'))));
    Kirki::add_field('gannet_config', array('type' => 'slider', 'settings' => 'base_type_font_weight', 'label' => __('Font Weight', 'gannet'), 'section' => 'base_type', 'default' => 300, 'priority' => 24, 'choices' => array('min' => 100, 'max' => 900, 'step' => 100), 'transport' => 'postMessage', 'js_vars' => array(array('element' => 'body', 'function' => 'css', 'property' => 'font-weight'))));
    /**
     * Base Font Size
     */
    Kirki::add_field('gannet_config', array('type' => 'slider', 'settings' => 'base_type_font_size', 'label' => __('Base Font Size', 'gannet'), 'section' => 'base_type', 'default' => 14, 'priority' => 25, 'choices' => array('min' => 12, 'max' => 30, 'step' => 1), 'output' => array(array('element' => 'body', 'property' => 'font-size', 'units' => 'px')), 'transport' => 'postMessage', 'js_vars' => array(array('element' => 'body', 'function' => 'css', 'property' => 'font-size', 'units' => 'px'))));
}
Exemple #23
0
<?php

Kirki::add_section('theme_front_video', array('title' => __('Video på forsiden'), 'description' => __('Indsæt en video fra youtube på hjemmesidens forside'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('front_video', array('settings' => 'smamo_front_video', 'label' => __('Video url', 'smamo'), 'type' => 'url', 'section' => 'theme_front_video', 'priority' => 10, 'default' => null));
Exemple #24
0
<?php

Kirki::add_section('topbar', array('title' => __('Forsidens top bar'), 'description' => __('Indstillinger for forsidens gule top bar'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('faaborg_gym', array('type' => 'select', 'settings' => 'topbar_show', 'label' => __('I hjemmesidens top på forsiden, vis', 'fagy'), 'section' => 'topbar', 'default' => 'icons', 'priority' => 20, 'multiple' => 1, 'choices' => array('icons' => esc_attr__('Ikoner og søgebar', 'fagy'), 'pt-preview' => esc_attr__('Forvsining af projekter og temaer', 'fagy'))));
// Indstillinger for ikoner
$icons_active = array('setting' => 'topbar_show', 'operator' => '===', 'value' => 'icons');
Kirki::add_field('faaborg_gym', array('type' => 'repeater', 'priority' => 30, 'label' => __('Ikoner', 'fagy'), 'settings' => 'topbar_icons', 'section' => 'topbar', 'row_label' => array('type' => 'text', 'value' => 'Ikon'), 'add_new' => 'Tilføj ikon', 'active_callback' => array($icons_active), 'default' => array(), 'fields' => array('icon_type' => array('type' => 'select', 'label' => esc_attr__('Ikon', 'fagy'), 'description' => esc_attr__('Vælg ikonets type', 'fagy'), 'default' => '', 'choices' => array('email' => __('Email', 'fagy'), 'phone' => __('Telefon', 'fagy'), 'facebook' => __('Facebook', 'fagy'), 'instagram' => __('Instagram', 'fagy'), 'lectio' => __('Lectio', 'fagy'), 'googleplus' => __('Google +', 'fagy'), 'youtube' => __('Youtube', 'fagy'))), 'icon_url' => array('type' => 'text', 'label' => esc_attr__('Henvsining', 'fagy'), 'description' => esc_attr__('Indtast URL', 'fagy'), 'default' => ''))));
Kirki::add_field('faaborg_gym', array('type' => 'toggle', 'settings' => 'topbar_search', 'label' => __('Tilføj en søgefunktion', 'fagy'), 'section' => 'topbar', 'active_callback' => array($icons_active), 'default' => '1', 'priority' => 40));
 /**
  * Add new section element
  *
  * @param \WP_Customize_Manager $wp_customize class object instants
  *
  * @access private
  */
 private function addSection()
 {
     $params = $this->getSectionParams();
     if (isset($this->panel_id)) {
         $params['panel'] = $this->panel_id;
     }
     /* TODO implements auto priority settings
        if ( ! in_array( 'priority', $params ) ) {
            $sections = $wp_customize->sections();
            foreach($sections as $section) {
                silverwp_debug_array($section->priority);
            }
            //end();
        }*/
     \Kirki::add_section($this->name, $params);
     //$wp_customize->add_section( $this->name, $params );
 }
Exemple #26
0
Kirki::add_section('shamrock_single', array('priority' => 101, 'title' => __('Single Post', 'shamrock'), 'description' => __('These are settings which are applied to your single post template', 'shamrock')));
Kirki::add_field('shamrock_settings', array('type' => 'radio', 'setting' => 'single_layout', 'label' => __('Single posts layout', 'shamrock'), 'section' => 'shamrock_single', 'default' => 'sidebar', 'choices' => array('sidebar' => __('With Sidebar', 'shamrock'), 'classic' => __('Full Width (no sidebar)', 'shamrock'))));
Kirki::add_field('shamrock_settings', array('type' => 'checkbox', 'setting' => 'single_show_fimg', 'label' => __('Display featured image', 'shamrock'), 'section' => 'shamrock_single', 'default' => 1));
Kirki::add_field('shamrock_settings', array('type' => 'checkbox', 'setting' => 'single_show_cat', 'label' => __('Display category', 'shamrock'), 'section' => 'shamrock_single', 'default' => 1));
Kirki::add_field('shamrock_settings', array('type' => 'multicheck', 'setting' => 'single_meta', 'label' => __('Display post meta data', 'shamrock'), 'section' => 'shamrock_single', 'default' => array('date', 'author', 'rtime', 'comments'), 'choices' => array('date' => __('Date', 'shamrock'), 'author' => __('Author', 'shamrock'), 'rtime' => __('Reading time', 'shamrock'), 'comments' => __('Comments', 'shamrock'))));
Kirki::add_field('shamrock_settings', array('type' => 'checkbox', 'setting' => 'single_show_tags', 'label' => __('Display tags', 'shamrock'), 'section' => 'shamrock_single', 'default' => 1));
Kirki::add_field('shamrock_settings', array('type' => 'checkbox', 'setting' => 'single_show_prev_next', 'label' => __('Display previous/next post links', 'shamrock'), 'section' => 'shamrock_single', 'default' => 1));
Kirki::add_field('shamrock_settings', array('type' => 'checkbox', 'setting' => 'prev_next_cat', 'label' => __('Previous/next links to posts from same category?', 'shamrock'), 'section' => 'shamrock_single', 'default' => 1, 'required' => array(array('setting' => 'single_show_prev_next', 'operator' => '==', 'value' => 1))));
Kirki::add_field('shamrock_settings', array('type' => 'checkbox', 'setting' => 'single_show_author', 'label' => __('Display author info', 'shamrock'), 'section' => 'shamrock_single', 'default' => 1));
/* Colors */
Kirki::add_section('shamrock_colors', array('priority' => 101, 'title' => __('Colors', 'shamrock'), 'description' => __('Use these settings to manage theme colors.', 'shamrock')));
Kirki::add_field('shamrock_settings', array('type' => 'color', 'settings' => 'color_body_bg', 'label' => __('Background color', 'shamrock'), 'description' => __('Used for body background', 'shamrock'), 'section' => 'shamrock_colors', 'default' => '#ffffff', 'priority' => 101));
Kirki::add_field('shamrock_settings', array('type' => 'color', 'settings' => 'color_txt', 'label' => __('Text color', 'shamrock'), 'description' => __('This is the color for standard text', 'shamrock'), 'section' => 'shamrock_colors', 'default' => '#333333', 'priority' => 101));
Kirki::add_field('shamrock_settings', array('type' => 'color', 'settings' => 'color_h', 'label' => __('Headings color', 'shamrock'), 'description' => __('Used for titles, navigation and H elements', 'shamrock'), 'section' => 'shamrock_colors', 'default' => '#333333', 'priority' => 101));
Kirki::add_field('shamrock_settings', array('type' => 'color', 'settings' => 'color_acc', 'label' => __('Accent color', 'shamrock'), 'description' => __('Used for links, buttons and some special elements', 'shamrock'), 'section' => 'shamrock_colors', 'default' => '#d34836', 'priority' => 101));
Kirki::add_field('shamrock_settings', array('type' => 'color', 'settings' => 'color_cat', 'label' => __('Category color', 'shamrock'), 'description' => __('This is default color for category links/buttons', 'shamrock'), 'section' => 'shamrock_colors', 'default' => '#ffeb79', 'priority' => 101));
Kirki::add_field('shamrock_settings', array('type' => 'color', 'settings' => 'color_meta', 'label' => __('Meta color ', 'shamrock'), 'description' => __('Used for meta elements and some labels', 'shamrock'), 'section' => 'shamrock_colors', 'default' => '#999999', 'priority' => 101));
/* Images */
Kirki::add_section('shamrock_images', array('priority' => 101, 'title' => __('Image Sizes', 'shamrock'), 'description' => __('Theme will optionally generate two additional image sizes to fit the design. When you change this options, it is highy reccomemnded to run Force Regenerate Thumbnails plugin afterwards.', 'shamrock')));
Kirki::add_field('shamrock_settings', array('type' => 'checkbox', 'setting' => 'img_size_standard', 'label' => __('Generate standard featured image', 'shamrock'), 'description' => __('Used for regular templates with sidebar', 'shamrock'), 'section' => 'shamrock_images', 'default' => 1));
Kirki::add_field('shamrock_settings', array('type' => 'radio', 'setting' => 'img_size_standard_ratio', 'label' => __('Standard featured image ratio', 'shamrock'), 'section' => 'shamrock_images', 'choices' => array('original' => __('Original (do not crop)', 'shamrock'), '4_3' => __('4:3', 'shamrock'), '16_9' => __('16:9', 'shamrock'), 'custom' => __('Your custom ratio', 'shamrock')), 'default' => '16_9', 'required' => array(array('setting' => 'img_size_standard', 'operator' => '==', 'value' => 1))));
Kirki::add_field('shamrock_settings', array('type' => 'text', 'setting' => 'img_size_standard_custom', 'label' => '', 'description' => __('Specify your custom ratio for standard images (x:y)', 'shamrock'), 'section' => 'shamrock_images', 'default' => '', 'required' => array(array('setting' => 'img_size_standard', 'operator' => '==', 'value' => 1), array('setting' => 'img_size_standard_ratio', 'operator' => '==', 'value' => 'custom'))));
Kirki::add_field('shamrock_settings', array('type' => 'checkbox', 'setting' => 'img_size_full', 'label' => __('Generate full width featured image', 'shamrock'), 'description' => __('Used for templates with no sidebar', 'shamrock'), 'section' => 'shamrock_images', 'default' => 1));
Kirki::add_field('shamrock_settings', array('type' => 'radio', 'setting' => 'img_size_full_ratio', 'label' => __('Full width featured image ratio', 'shamrock'), 'section' => 'shamrock_images', 'choices' => array('original' => __('Original (do not crop)', 'shamrock'), '4_3' => __('4:3', 'shamrock'), '16_9' => __('16:9', 'shamrock'), 'custom' => __('Your custom ratio', 'shamrock')), 'default' => '16_9', 'required' => array(array('setting' => 'img_size_full', 'operator' => '==', 'value' => 1))));
Kirki::add_field('shamrock_settings', array('type' => 'text', 'setting' => 'img_size_full_custom', 'label' => '', 'description' => __('Specify your custom ratio for full width images (x:y)', 'shamrock'), 'section' => 'shamrock_images', 'default' => '', 'required' => array(array('setting' => 'img_size_full', 'operator' => '==', 'value' => 1), array('setting' => 'img_size_full_ratio', 'operator' => '==', 'value' => 'custom'))));
function shamrock_kirki_config($config)
{
    $config['url_path'] = trailingslashit(get_stylesheet_directory_uri()) . 'include/options/';
    return $config;
}
add_filter('kirki/config', 'shamrock_kirki_config');
Exemple #27
0
<?php

Kirki::add_section('theme_logo', array('title' => __('Logo'), 'description' => __('Tilføj logo til temaets positioner'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('smamo_conf', array('settings' => 'logo_large', 'label' => __('Stort logo', 'smamo'), 'section' => 'theme_logo', 'type' => 'image', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_conf', array('settings' => 'logo_medium', 'label' => __('Bredt logo', 'smamo'), 'section' => 'theme_logo', 'type' => 'image', 'priority' => 11, 'default' => null));
Kirki::add_field('smamo_conf', array('settings' => 'logo_small', 'label' => __('Lille logo', 'smamo'), 'section' => 'theme_logo', 'type' => 'image', 'priority' => 12, 'default' => null));
<?php

Kirki::add_section('hero_banner', array('title' => __('Hero Banner'), 'description' => __('Indstillinger for forsidens Hero Banner'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('faaborg_gym', array('type' => 'select', 'settings' => 'hero_banner_show', 'label' => __('I hero banner, vis', 'fagy'), 'section' => 'hero_banner', 'default' => 'video', 'priority' => 20, 'multiple' => 1, 'choices' => array('video' => esc_attr__('Video banner', 'fagy'), 'slideshow' => esc_attr__('Slideshow', 'fagy'))));
// Indstillinger for video banner
$video_active = array('setting' => 'hero_banner_show', 'operator' => '===', 'value' => 'video');
Kirki::add_field('faaborg_gym', array('type' => 'image', 'settings' => 'hb_video_img', 'label' => __('Baggrundsbillede', 'fagy'), 'description' => __('Vælg billede, der vises på touch apparater, og mens videoen indlæses', 'fagy'), 'section' => 'hero_banner', 'default' => '', 'priority' => 21, 'active_callback' => array($video_active)));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'settings' => 'hb_video_link', 'label' => __('Youtube link', 'fagy'), 'section' => 'hero_banner', 'priority' => 22, 'active_callback' => array($video_active)));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'settings' => 'hb_video_heading', 'label' => __('Header', 'fagy'), 'section' => 'hero_banner', 'priority' => 23, 'active_callback' => array($video_active)));
Kirki::add_field('faaborg_gym', array('type' => 'checkbox', 'priority' => 24, 'label' => 'Opret et preview loop', 'settings' => 'hb_video_loop_active', 'default' => 0, 'section' => 'hero_banner', 'active_callback' => array($video_active)));
Kirki::add_field('faaborg_gym', array('type' => 'slider', 'priority' => 26, 'label' => __('Loop start (sekunder)', 'fagy'), 'settings' => 'hb_video_loop_start', 'section' => 'hero_banner', 'default' => '5', 'active_callback' => array($video_active, array('setting' => 'hb_video_loop_active', 'operator' => '===', 'value' => '1')), 'choices' => array('min' => '0', 'max' => '120', 'step' => '1')));
Kirki::add_field('faaborg_gym', array('type' => 'slider', 'priority' => 27, 'label' => __('Loop varighed (sekunder)', 'fagy'), 'settings' => 'hb_video_loop_end', 'section' => 'hero_banner', 'default' => '10', 'active_callback' => array($video_active, array('setting' => 'hb_video_loop_active', 'operator' => '===', 'value' => '1')), 'choices' => array('min' => '1', 'max' => '60', 'step' => '1')));
// Indstillinger for slideshow
$slideshow_active = array('setting' => 'hero_banner_show', 'operator' => '===', 'value' => 'slideshow');
Kirki::add_field('faaborg_gym', array('type' => 'slider', 'priority' => 26, 'label' => __('Vis slide i (millisekunder)', 'fagy'), 'settings' => 'hero_banner_slide_timeout', 'section' => 'hero_banner', 'default' => '7000', 'active_callback' => array($slideshow_active), 'choices' => array('min' => '1000', 'max' => '20000', 'step' => '100')));
Kirki::add_field('faaborg_gym', array('type' => 'slider', 'priority' => 27, 'label' => __('Transition (millisekunder)', 'fagy'), 'settings' => 'hero_banner_slide_transition', 'section' => 'hero_banner', 'default' => '400', 'active_callback' => array($slideshow_active), 'choices' => array('min' => '50', 'max' => '1000', 'step' => '10')));
Kirki::add_field('faaborg_gym', array('type' => 'repeater', 'priority' => 30, 'label' => __('Slides', 'fagy'), 'settings' => 'hero_banner_slides', 'section' => 'hero_banner', 'row_label' => array('type' => 'text', 'value' => 'Slide'), 'add_new' => 'Tilføj slide', 'active_callback' => array($slideshow_active), 'default' => array(), 'fields' => array(0 => array('label' => __('Billede', 'rwmb'), 'type' => 'image'), 1 => array('label' => __('Overskrift', 'rwmb'), 'type' => 'text'), 2 => array('label' => __('Underoverskrift', 'rwmb'), 'type' => 'textarea'), 3 => array('label' => __('Link', 'rwmb'), 'type' => 'url'), 4 => array('label' => __('Åben i nyt vindue', 'rwmb'), 'type' => 'checkbox'))));
Exemple #29
0
{
    wp_enqueue_style('kirki-demo', Kirki::$url . '/demo-theme/style.css', array(), time());
}
add_action('wp_enqueue_scripts', 'kirki_demo_scripts');
if (class_exists('Kirki')) {
    /**
     * Add sections
     */
    Kirki::add_section('checkbox', array('title' => esc_attr__('Checkbox Controls', 'kirki-demo'), 'priority' => 1, 'capability' => 'edit_theme_options'));
    Kirki::add_section('text', array('title' => esc_attr__('Text Controls', 'kirki-demo'), 'priority' => 2, 'capability' => 'edit_theme_options'));
    Kirki::add_section('color', array('title' => esc_attr__('Color & Color-Alpha Controls', 'kirki-demo'), 'priority' => 3, 'capability' => 'edit_theme_options'));
    Kirki::add_section('numeric', array('title' => esc_attr__('Numeric Controls', 'kirki-demo'), 'priority' => 4, 'capability' => 'edit_theme_options'));
    Kirki::add_section('radio', array('title' => esc_attr__('Radio Controls', 'kirki-demo'), 'priority' => 5, 'capability' => 'edit_theme_options'));
    Kirki::add_section('select', array('title' => esc_attr__('Select Controls', 'kirki-demo'), 'priority' => 6, 'capability' => 'edit_theme_options'));
    Kirki::add_section('composite', array('title' => esc_attr__('Composite Controls', 'kirki-demo'), 'priority' => 7, 'capability' => 'edit_theme_options'));
    Kirki::add_section('custom', array('title' => esc_attr__('Custom Control', 'kirki-demo'), 'priority' => 4, 'capability' => 'edit_theme_options'));
    /**
     * Add the configuration.
     * This way all the fields using the 'kirki_demo' ID
     * will inherit these options
     */
    Kirki::add_config('kirki_demo', array('capability' => 'edit_theme_options', 'option_type' => 'theme_mod'));
    /**
     * Add fields
     */
    Kirki::add_field('kirki_demo', array('type' => 'checkbox', 'settings' => 'checkbox_demo', 'label' => esc_attr__('Checkbox demo', 'kirki'), 'description' => esc_attr__('This is a simple checkbox', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'checkbox', 'default' => true, 'priority' => 10));
    Kirki::add_field('kirki_demo', array('type' => 'switch', 'settings' => 'switch_demo', 'label' => esc_attr__('Switch demo', 'kirki'), 'description' => esc_attr__('This is a switch control. Internally it is a checkbox and you can also change the ON/OFF labels.', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'checkbox', 'default' => true, 'priority' => 10, 'required' => array(array('setting' => 'checkbox_demo', 'operator' => '==', 'value' => true))));
    Kirki::add_field('kirki_demo', array('type' => 'toggle', 'settings' => 'toggle_demo', 'label' => esc_attr__('Toggle demo', 'kirki'), 'description' => esc_attr__('This is a toggle. it is basically identical to a switch, the only difference is that it does not have any labels and to save space it is inline with the label. Internally this is a checkbox.', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'checkbox', 'default' => true, 'priority' => 10));
    Kirki::add_field('kirki_demo', array('type' => 'text', 'settings' => 'text_demo', 'label' => esc_attr__('Text Control', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'default' => esc_attr__('This text is entered in the "text" control.', 'kirki-demo'), 'section' => 'text', 'default' => '', 'priority' => 10));
    Kirki::add_field('kirki_demo', array('type' => 'textarea', 'settings' => 'textarea_demo', 'label' => esc_attr__('Textarea Control', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'default' => esc_attr__('This text is entered in the "textarea" control.', 'kirki-demo'), 'section' => 'text', 'default' => '', 'priority' => 10));
    Kirki::add_field('kirki_demo', array('type' => 'editor', 'settings' => 'editor_demo', 'label' => esc_attr__('Editor Control', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'text', 'default' => esc_attr__('This text is entered in the "editor" control.', 'kirki-demo'), 'priority' => 10));
Exemple #30
0
 /**
  * Set up the Kirki Customizer
  */
 public function setupKirkiCustomizer()
 {
     \Kirki::add_config($this->textdomain, array('capability' => 'edit_theme_options', 'option_type' => 'option'));
     add_filter('kirki/config', function ($config) {
         $config['styles_priority'] = 100000;
         return $config;
     });
     add_filter('kirki/control_types', function ($controls) {
         $controls['media'] = '\\WP_Customize_Media_Control';
         $controls['cropped_image'] = '\\WP_Customize_Cropped_Image_Control';
         return $controls;
     });
     $panels = $this->setting('customizer/panels', []);
     if (count($panels) > 0) {
         foreach ($panels as $key => $data) {
             \Kirki::add_panel($key, $data);
         }
     }
     $sections = $this->setting('customizer/sections', []);
     if (count($sections) > 0) {
         foreach ($sections as $key => $data) {
             \Kirki::add_section($key, $data);
         }
     }
     $settings = $this->setting('customizer/settings', []);
     if (count($settings) > 0) {
         foreach ($settings as $setting => $data) {
             $control = null;
             if (isset($data['control'])) {
                 $control = $data['control'];
                 unset($data['control']);
             }
             if ($control) {
                 $data = array_merge($data, $control);
             }
             $data['settings'] = $setting;
             \Kirki::add_field($this->textdomain, $data);
         }
     }
 }