'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, ) ); 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' => blogmaster_get_cats(), '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( 'background-color' => '#f4f4f4', 'background-image' => '', 'background-repeat' => 'no-repeat', 'background-size' => 'cover', 'background-attachment' => 'fixed', 'background-position' => 'center-top', ), 'priority' => 10, 'output' => array( array( 'element' => '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' => '
', 'priority' => 10, ) ); } /** * Configuration sample for the blogmaster Customizer. */ function blogmaster_configuration() { $config[ 'color_back' ] = '#192429'; $config[ 'color_accent' ] = '#008ec2'; $config[ 'width' ] = '25%'; return $config; } add_filter( 'kirki/config', 'blogmaster_configuration' ); function blogmaster_get_cats() { /* GET LIST OF CATEGORIES */ $layercats = get_categories(); $newList = array(); $newList[ '0' ] = __( 'All categories', 'blogmaster' ); foreach ( $layercats as $category ) { $newList[ $category->term_id ] = $category->cat_name; } return $newList; }