add_panel( 'barkly_panel', array( 'title' => __( 'Barkly Settings', 'barkly' ), 'priority' => 10, ) ); /* ADD SECTION */ $customizer->add_section( 'barkly_general', array( 'title' => __( 'General ', 'barkly' ), 'description' => '', 'priority' => 10, 'panel' => 'barkly_panel', ) ); $customizer->add_section( 'barkly_header', array( 'title' => __( 'Header', 'barkly' ), 'description' => '', 'priority' => 11, 'panel' => 'barkly_panel', ) ); $customizer->add_section( 'barkly_breadcrums', array( 'title' => __( 'Breadcrumbs', 'barkly' ), 'description' => '', 'priority' => 12, 'panel' => 'barkly_panel', ) ); $customizer->add_section( 'barkly_posts', array( 'title' => __( 'Single post', 'barkly' ), 'description' => '', 'priority' => 13, 'panel' => 'barkly_panel', ) ); $customizer->add_section( 'barkly_footer', array( 'title' => __( 'Footer', 'barkly' ), 'description' => '', 'priority' => 16, 'panel' => 'barkly_panel', ) ); /* General */ $customizer->add_setting( 'barkly_general_widgets', array('default' => 'grey') ); $customizer->add_control( 'barkly_general_widgets', array( 'type' => 'select', 'label' => __( 'Widgets Style', 'barkly' ), 'section' => 'barkly_general', 'choices' => array( 'grey' => 'Grey theme', 'minimal' => 'Minimal theme', ), ) ); $customizer->add_setting( 'barkly_general_postlist_style', array('default' => 'classic') ); $customizer->add_control( 'barkly_general_postlist_style', array( 'type' => 'select', 'description' => __( 'Blog Layout', 'barkly' ), 'label' => __( 'Output template style', 'barkly' ), 'section' => 'barkly_general', 'choices' => array( 'classic' => 'Classic style', 'grid' => 'Small thumbnail', 'list' => 'List', ), ) ); $customizer->add_setting( 'barkly_general_category_style', array('default' => 'classic') ); $customizer->add_control( 'barkly_general_category_style', array( 'type' => 'select', 'description' => __( 'Category Layout', 'barkly' ), 'section' => 'barkly_general', 'choices' => array( 'classic' => 'Classic style', 'grid' => 'Small thumbnail', 'list' => 'List', ), ) ); $customizer->add_setting( 'barkly_general_archive_style', array('default' => 'classic') ); $customizer->add_control( 'barkly_general_archive_style', array( 'type' => 'select', 'description' => __( 'Archive Layout', 'barkly' ), 'section' => 'barkly_general', 'choices' => array( 'classic' => 'Classic style', 'grid' => 'Small thumbnail', 'list' => 'List', ), ) ); $customizer->add_setting( 'barkly_general_link', array( 'default' => '#427eb9', 'sanitize_callback' => 'sanitize_hex_color', ) ); $customizer->add_control( new WP_Customize_Color_Control( $customizer, 'barkly_general_link', array( 'label' => __( 'Accent Color', 'barkly' ), 'section' => 'barkly_general', 'settings' => 'barkly_general_link', ) ) ); $customizer->add_setting( 'barkly_general_excerpt_size', array('default' => '25') ); $customizer->add_control( 'barkly_general_excerpt_size', array( 'label' => __( 'Excerpt length', 'barkly' ), 'section' => 'barkly_general', 'type' => 'number', ) ); $customizer->add_setting( 'barkly_general_prp', array('default' => '5') ); $customizer->add_control( 'barkly_general_prp', array( 'description' => __( 'Blog Page', 'barkly' ), 'label' => __( 'Posts per page', 'barkly' ), 'section' => 'barkly_general', 'type' => 'number', ) ); $customizer->add_setting( 'barkly_general_prt', array('default' => '10') ); $customizer->add_control( 'barkly_general_prt', array( 'description' => __( 'Tag Page', 'barkly' ), 'section' => 'barkly_general', 'type' => 'number', ) ); $customizer->add_setting( 'barkly_general_prc', array('default' => '5') ); $customizer->add_control( 'barkly_general_prc', array( 'description' => __( 'Category Page', 'barkly' ), 'section' => 'barkly_general', 'type' => 'number', ) ); $customizer->add_setting( 'barkly_general_prs', array('default' => '10') ); $customizer->add_control( 'barkly_general_prs', array( 'description' => __( 'Search Page', 'barkly' ), 'section' => 'barkly_general', 'type' => 'number', ) ); $customizer->add_setting( 'barkly_general_pra', array('default' => '10') ); $customizer->add_control( 'barkly_general_pra', array( 'description' => __( 'Archive Page', 'barkly' ), 'section' => 'barkly_general', 'type' => 'number', ) ); /* Header */ $customizer->add_setting( 'barkly_header_sticky', array('default' => false) ); $customizer->add_control( 'barkly_header_sticky', array( 'label' => __( 'Sticky Main Menu', 'barkly' ), 'section' => 'barkly_header', 'type' => 'checkbox', ) ); $customizer->add_setting( 'barkly_header_mainmenu', array('default' => 'dark') ); $customizer->add_control( 'barkly_header_mainmenu', array( 'type' => 'select', 'label' => __( 'Main Menu Style', 'barkly' ), 'section' => 'barkly_header', 'choices' => array( 'dark' => 'Dark theme', 'white' => 'White theme', 'light' => 'Light theme', 'custom' => 'Custom theme', ), ) ); $customizer->add_setting( 'barkly_header_mainmenu_custom', array( 'default' => '#000000', 'sanitize_callback' => 'sanitize_hex_color', ) ); $customizer->add_control( new WP_Customize_Color_Control( $customizer, 'barkly_header_mainmenu_custom', array( 'label' => __( 'Set a custom background for the Main Menu', 'barkly' ), 'section' => 'barkly_header', 'settings' => 'barkly_header_mainmenu_custom', 'active_callback' => 'barkly_has_custom_menu', ) ) ); $customizer->add_setting( 'barkly_header_fluid', array('default' => false) ); $customizer->add_control( 'barkly_header_fluid', array( 'label' => __( 'Fluid Main Menu', 'barkly' ), 'section' => 'barkly_header', 'type' => 'checkbox', ) ); /* Breadcrumbs */ $customizer->add_setting( 'barkly_breadcrumb_post_show', array('default' => false) ); $customizer->add_control( 'barkly_breadcrumb_post_show', array( 'label' => __( 'Display Post breadcrumbs', 'barkly' ), 'section' => 'barkly_breadcrums', 'type' => 'checkbox', ) ); $customizer->add_setting( 'barkly_breadcrumb_page_show', array('default' => false) ); $customizer->add_control( 'barkly_breadcrumb_page_show', array( 'label' => __( 'Display Page breadcrumbs', 'barkly' ), 'section' => 'barkly_breadcrums', 'type' => 'checkbox', ) ); $customizer->add_setting( 'barkly_breadcrumb_archive_show', array('default' => false) ); $customizer->add_control( 'barkly_breadcrumb_archive_show', array( 'label' => __( 'Display Archive breadcrumbs', 'barkly' ), 'section' => 'barkly_breadcrums', 'type' => 'checkbox', ) ); $customizer->add_setting( 'barkly_breadcrumb_sep', array('default' => 'ยป') ); $customizer->add_control( 'barkly_breadcrumb_sep', array( 'label' => __( 'Breadcrumbs separator', 'barkly' ), 'section' => 'barkly_breadcrums', 'type' => 'text', ) ); $customizer->add_setting( 'barkly_breadcrumb_name', array('default' => 'Home') ); $customizer->add_control( 'barkly_breadcrumb_name', array( 'label' => __( 'Breadcrumbs main link name', 'barkly' ), 'section' => 'barkly_breadcrums', 'type' => 'text', ) ); $customizer->add_setting( 'barkly_breadcrumb_url', array('default' => '/') ); $customizer->add_control( 'barkly_breadcrumb_url', array( 'label' => __( 'Breadcrumbs main link url', 'barkly' ), 'section' => 'barkly_breadcrums', 'type' => 'text', ) ); /* Single post */ $customizer->add_setting( 'barkly_posts_meta_author', array('default' => true) ); $customizer->add_control( 'barkly_posts_meta_author', array( 'label' => __( 'Display author', 'barkly' ), 'section' => 'barkly_posts', 'type' => 'checkbox', ) ); $customizer->add_setting( 'barkly_posts_meta_date', array('default' => true) ); $customizer->add_control( 'barkly_posts_meta_date', array( 'label' => __( 'Display post date', 'barkly' ), 'section' => 'barkly_posts', 'type' => 'checkbox', ) ); $customizer->add_setting( 'barkly_posts_meta_category', array('default' => true) ); $customizer->add_control( 'barkly_posts_meta_category', array( 'label' => __( 'Display post category', 'barkly' ), 'section' => 'barkly_posts', 'type' => 'checkbox', ) ); $customizer->add_setting( 'barkly_posts_layout', array('default' => 'item_1') ); $customizer->add_control( 'barkly_posts_layout', array( 'type' => 'radio', 'label' => __( 'Layout', 'barkly'), 'section' => 'barkly_posts', 'choices' => array( 'item_1' => __('Sidebar', 'barkly' ), 'item_2' => __('Full Width', 'barkly' ), ), ) ); $customizer->add_setting( 'barkly_posts_exc', array('default' => false) ); $customizer->add_control( 'barkly_posts_exc', array( 'label' => __( 'Display excerpt on single post page', 'barkly' ), 'section' => 'barkly_posts', 'type' => 'checkbox', ) ); /* Sidebar */ /* Footer */ $customizer->add_setting( 'barkly_footer_text', array('default' => 'Footer text') ); $customizer->add_control( 'barkly_footer_text', array( 'label' => __( 'Footer text', 'barkly' ), 'section' => 'barkly_footer', 'type' => 'text', ) ); }); function barkly_has_custom_menu( $control ) { if ( $control->manager->get_setting('barkly_header_mainmenu')->value() == 'custom' ) { return true; } else { return false; } }