'edit_theme_options', 'option_type' => 'theme_mod', ) ); /** * Add sections */ Kirki::add_section( 'sidebar_section', array( 'title' => __( 'Sidebars', 'blogmaster' ), 'priority' => 10, 'description' => __( 'Sidebar layouts.', 'blogmaster' ), ) ); Kirki::add_section( 'layout_section', array( 'title' => __( 'Main styling', 'blogmaster' ), 'priority' => 10, 'description' => __( 'Define theme layout', 'blogmaster' ), ) ); Kirki::add_section( 'post_section', array( 'title' => __( 'Post settings', 'blogmaster' ), 'priority' => 10, 'description' => __( 'Single post settings', 'blogmaster' ), ) ); Kirki::add_section( 'site_bg_section', array( 'title' => __( 'Site Background', 'blogmaster' ), 'priority' => 10, ) ); Kirki::add_section( 'colors_section', array( 'title' => __( 'Colors and Typography', 'blogmaster' ), 'priority' => 10, ) ); Kirki::add_section( 'links_section', array( 'title' => __( 'Theme Important Links', 'blogmaster' ), 'priority' => 190, ) ); Kirki::add_field( 'blogmaster_settings', array( 'type' => 'switch', 'settings' => 'rigth-sidebar-check', 'label' => __( 'Right Sidebar', 'blogmaster' ), 'description' => __( 'Enable the Right Sidebar', 'blogmaster' ), 'section' => 'sidebar_section', 'default' => 1, 'priority' => 10, ) ); Kirki::add_field( 'blogmaster_settings', array( 'type' => 'radio-buttonset', 'settings' => 'right-sidebar-size', 'label' => __( 'Right Sidebar Size', 'blogmaster' ), 'section' => 'sidebar_section', 'default' => '3', 'priority' => 10, 'choices' => array( '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5' ), 'required' => array( array( 'setting' => 'rigth-sidebar-check', 'operator' => '==', 'value' => 1, ), ) ) ); Kirki::add_field( 'blogmaster_settings', array( 'type' => 'switch', 'settings' => 'left-sidebar-check', 'label' => __( 'Left Sidebar', 'blogmaster' ), 'description' => __( 'Enable the Left Sidebar', 'blogmaster' ), 'section' => 'sidebar_section', 'default' => 0, 'priority' => 10, ) ); Kirki::add_field( 'blogmaster_settings', array( 'type' => 'radio-buttonset', 'settings' => 'left-sidebar-size', 'label' => __( 'Left Sidebar Size', 'blogmaster' ), 'section' => 'sidebar_section', 'default' => '2', 'priority' => 10, 'choices' => array( '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5' ), 'required' => array( array( 'setting' => 'left-sidebar-check', 'operator' => '==', 'value' => 1, ), ) ) ); Kirki::add_field( 'blogmaster_settings', array( 'type' => 'image', 'settings' => 'header-logo', 'label' => __( 'Logo', 'blogmaster' ), 'description' => __( 'Upload your logo. Max. height 50px!', 'blogmaster' ), 'section' => 'layout_section', 'default' => '', 'priority' => 10, ) ); Kirki::add_field( 'blogmaster_settings', array( 'type' => 'switch', 'settings' => 'get-featured', 'label' => __( 'Slider', 'blogmaster' ), 'description' => __( 'Enable or disable slider on homepage', 'blogmaster' ), 'section' => 'layout_section', 'default' => 0, 'priority' => 10, ) ); /*GET LIST OF CATEGORIES*/ $layercats = get_categories(); $newList = array(); $newList['0'] = __('Select Category', 'blogmaster'); foreach($layercats as $category) { $newList[$category->term_id] = $category->cat_name; } Kirki::add_field( 'blogmaster_settings', array( 'type' => 'select', 'settings' => 'featured-categories', 'label' => __( 'Slider category', 'blogmaster' ), 'description' => __( 'Select category for slider', 'blogmaster' ), 'section' => 'layout_section', 'default' => '', 'priority' => 10, 'choices' => $newList, 'required' => array( array( 'setting' => 'get-featured', 'operator' => '==', 'value' => 1, ), ) ) ); Kirki::add_field( 'blogmaster_settings', array( 'type' => 'switch', 'settings' => 'related-posts-check', 'label' => __( 'Related posts', 'blogmaster' ), 'description' => __( 'Enable or disable related posts', 'blogmaster' ), 'section' => 'post_section', 'default' => 1, 'priority' => 10, ) ); Kirki::add_field( 'blogmaster_settings', array( 'type' => 'switch', 'settings' => 'author-check', 'label' => __( 'Author box', 'blogmaster' ), 'description' => __( 'Enable or disable author box', 'blogmaster' ), 'section' => 'post_section', 'default' => 1, 'priority' => 10, ) ); Kirki::add_field( 'blogmaster_settings', array( 'type' => 'switch', 'settings' => 'post-nav-check', 'label' => __( 'Post navigation', 'blogmaster' ), 'description' => __( 'Enable or disable navigation below post content', 'blogmaster' ), 'section' => 'post_section', 'default' => 1, 'priority' => 10, ) ); Kirki::add_field( 'blogmaster_settings', array( 'type' => 'switch', 'settings' => 'breadcrumbs-check', 'label' => __( 'Breadcrumbs', 'blogmaster' ), 'description' => __( 'Enable or disable Breadcrumbs', 'blogmaster' ), 'section' => 'post_section', 'default' => 1, 'priority' => 10, ) ); Kirki::add_field( 'blogmaster_settings', array( 'type' => 'color', 'settings' => 'color_site_title', 'label' => __( 'Site title color', 'blogmaster' ), 'help' => __( 'Site title text color, if not defined logo.', 'blogmaster' ), 'section' => 'colors_section', 'default' => '#fff', 'priority' => 10, 'output' => array( array( 'element' => '.rsrc-header-text a', 'property' => 'color', 'units' => ' !important', ), ), ) ); Kirki::add_field( 'blogmaster_settings', array( 'type' => 'background', 'settings' => 'background_site', 'label' => __( 'Background', 'blogmaster' ), 'section' => 'site_bg_section', 'default' => array( 'color' => '#f4f4f4', 'image' => '', 'repeat' => 'no-repeat', 'size' => 'cover', 'attach' => 'fixed', 'position' => 'center-top', 'opacity' => 100, ), 'priority' => 10, 'output' => 'body', ) ); $theme_links = array( 'documentation' => array( 'link' => esc_url('http://demo.themes4wp.com/documentation/category/blogmaster/'), 'text' => __('Documentation', 'blogmaster'), 'settings' => 'theme-docs', ), 'support' => array( 'link' => esc_url('http://support.themes4wp.com/'), 'text' => __('Support', 'blogmaster'), 'settings' => 'theme-support', ), 'demo' => array( 'link' => esc_url('http://demo.themes4wp.com/blogmaster/'), 'text' => __('View Demo', 'blogmaster'), 'settings' => 'theme-demo', ), 'rating' => array( 'link' => esc_url('https://wordpress.org/support/view/theme-reviews/blogmaster'), 'text' => __('Rate This Theme', 'blogmaster'), 'settings' => 'theme-rate', ) ); foreach ($theme_links as $theme_link) { Kirki::add_field( 'blogmaster_settings', array( 'type' => 'custom', 'settings' => $theme_link['settings'], 'section' => 'links_section', 'default' => '
' . esc_attr($theme_link['text']) . '
', 'priority' => 10, ) ); } /** * Configuration sample for the blogmaster Customizer. */ function blogmaster_configuration() { $config['description'] = __( 'BlogMaster is a simple way to create your Personal WordPress Blog or Magazine, with no technical knowledge or expertise required.', 'blogmaster' ); $config['color_back'] = '#192429'; $config['width'] = '25%'; return $config; } add_filter( 'kirki/config', 'blogmaster_configuration' ); function blogmaster_configuration_i18n( $config ) { $strings = array( 'background-color' => __( 'Background Color', 'blogmaster' ), 'background-image' => __( 'Background Image', 'blogmaster' ), 'no-repeat' => __( 'No Repeat', 'blogmaster' ), 'repeat-all' => __( 'Repeat All', 'blogmaster' ), 'repeat-x' => __( 'Repeat Horizontally', 'blogmaster' ), 'repeat-y' => __( 'Repeat Vertically', 'blogmaster' ), 'inherit' => __( 'Inherit', 'blogmaster' ), 'background-repeat' => __( 'Background Repeat', 'blogmaster' ), 'cover' => __( 'Cover', 'blogmaster' ), 'contain' => __( 'Contain', 'blogmaster' ), 'background-size' => __( 'Background Size', 'blogmaster' ), 'fixed' => __( 'Fixed', 'blogmaster' ), 'scroll' => __( 'Scroll', 'blogmaster' ), 'background-attachment' => __( 'Background Attachment', 'blogmaster' ), 'left-top' => __( 'Left Top', 'blogmaster' ), 'left-center' => __( 'Left Center', 'blogmaster' ), 'left-bottom' => __( 'Left Bottom', 'blogmaster' ), 'right-top' => __( 'Right Top', 'blogmaster' ), 'right-center' => __( 'Right Center', 'blogmaster' ), 'right-bottom' => __( 'Right Bottom', 'blogmaster' ), 'center-top' => __( 'Center Top', 'blogmaster' ), 'center-center' => __( 'Center Center', 'blogmaster' ), 'center-bottom' => __( 'Center Bottom', 'blogmaster' ), 'background-position' => __( 'Background Position', 'blogmaster' ), 'background-opacity' => __( 'Background Opacity', 'blogmaster' ), 'ON' => __( 'ON', 'blogmaster' ), 'OFF' => __( 'OFF', 'blogmaster' ), 'all' => __( 'All', 'blogmaster' ), 'cyrillic' => __( 'Cyrillic', 'blogmaster' ), 'cyrillic-ext' => __( 'Cyrillic Extended', 'blogmaster' ), 'devanagari' => __( 'Devanagari', 'blogmaster' ), 'greek' => __( 'Greek', 'blogmaster' ), 'greek-ext' => __( 'Greek Extended', 'blogmaster' ), 'khmer' => __( 'Khmer', 'blogmaster' ), 'latin' => __( 'Latin', 'blogmaster' ), 'latin-ext' => __( 'Latin Extended', 'blogmaster' ), 'vietnamese' => __( 'Vietnamese', 'blogmaster' ), 'serif' => _x( 'Serif', 'font style', 'blogmaster' ), 'sans-serif' => _x( 'Sans Serif', 'font style', 'blogmaster' ), 'monospace' => _x( 'Monospace', 'font style', 'blogmaster' ), ); $config['i18n'] = $strings; return $config; } add_filter( 'kirki/config', 'blogmaster_configuration_i18n' );