'edit_theme_options', 'option_type' => 'theme_mod', ) ); /** * Add sections */ Kirki::add_section( 'sidebar_section', array( 'title' => __( 'Sidebars', 'amigo' ), 'priority' => 1, 'description' => __( 'Sidebar layouts.', 'amigo' ), ) ); Kirki::add_section( 'layout_section', array( 'title' => __( 'Main styling', 'amigo' ), 'priority' => 2, 'description' => __( 'Define theme layout', 'amigo' ), ) ); Kirki::add_section( 'top_bar_section', array( 'title' => __( 'Social icons', 'amigo' ), 'priority' => 3, ) ); Kirki::add_section( 'post_section', array( 'title' => __( 'Post settings', 'amigo' ), 'priority' => 5, 'description' => __( 'Single post settings', 'amigo' ), ) ); Kirki::add_section( 'site_bg_section', array( 'title' => __( 'Site Background', 'amigo' ), 'priority' => 6, ) ); Kirki::add_section( 'colors_section', array( 'title' => __( 'Colors and Typography', 'amigo' ), 'priority' => 7, ) ); /** * Add the configuration. */ Kirki::add_config( 'amigo_settings', array( 'capability' => 'edit_theme_options', 'option_type' => 'theme_mod', ) ); /** * Add fields */ Kirki::add_field( 'amigo_settings', array( 'type' => 'switch', 'settings' => 'rigth-sidebar-check', 'label' => __( 'Right Sidebar', 'amigo' ), 'description' => __( 'Enable the Right Sidebar', 'amigo' ), 'section' => 'sidebar_section', 'default' => 1, 'priority' => 10, ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'radio-buttonset', 'settings' => 'right-sidebar-size', 'label' => __( 'Right Sidebar Size', 'amigo' ), 'section' => 'sidebar_section', 'default' => '4', '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( 'amigo_settings', array( 'type' => 'switch', 'settings' => 'left-sidebar-check', 'label' => __( 'Left Sidebar', 'amigo' ), 'description' => __( 'Enable the Left Sidebar', 'amigo' ), 'section' => 'sidebar_section', 'default' => 0, 'priority' => 10, ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'radio-buttonset', 'settings' => 'left-sidebar-size', 'label' => __( 'Left Sidebar Size', 'amigo' ), 'section' => 'sidebar_section', 'default' => '3', '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( 'amigo_settings', array( 'type' => 'radio-buttonset', 'settings' => 'footer-area-size', 'label' => __( 'Footer area size', 'amigo' ), 'section' => 'sidebar_section', 'default' => '3', 'priority' => 10, 'choices' => array( '12' => '1', '6' => '2', '4' => '3', '3' => '4', '15' => '5', '2' => '6' ), ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'image', 'settings' => 'header-logo', 'label' => __( 'Logo', 'amigo' ), 'description' => __( 'Upload your logo', 'amigo' ), 'section' => 'layout_section', 'default' => '', 'priority' => 10, ) ); /*GET LIST OF CATEGORIES*/ $layercats = get_categories(); $newList = array(); foreach($layercats as $category) { $newList[$category->term_id] = $category->cat_name; } Kirki::add_field( 'amigo_settings', array( 'type' => 'switch', 'settings' => 'get-carousel', 'label' => __( 'Carousel', 'amigo' ), 'description' => __( 'Enable or disable carousel', 'amigo' ), 'section' => 'layout_section', 'default' => 0, 'priority' => 10, ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'select', 'settings' => 'carousel-categories', 'label' => __( 'Carousel category', 'amigo' ), 'description' => __( 'Select category for carousel', 'amigo' ), 'section' => 'layout_section', 'default' => '', 'priority' => 10, 'choices' => $newList, 'required' => array( array( 'setting' => 'get-carousel', 'operator' => '==', 'value' => 1, ), ) ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'radio-buttonset', 'settings' => 'carousel-auto-slide', 'label' => __( 'Carousel autoplay', 'amigo' ), 'description' => __( 'Carousel automatic sliding', 'amigo' ), 'section' => 'layout_section', 'default' => 'true', 'priority' => 10, 'choices' => array( 'true' => __( 'Yes', 'amigo' ), 'false' => __( 'No', 'amigo' ), ), 'required' => array( array( 'setting' => 'get-carousel', 'operator' => '==', 'value' => 1, ), ) ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'radio-buttonset', 'settings' => 'carousel-everywhere', 'label' => __( 'Carousel placing', 'amigo' ), 'description' => __( 'Enable carousel everywhere or only on homepage', 'amigo' ), 'section' => 'layout_section', 'default' => 'home', 'priority' => 10, 'choices' => array( 'home' => __( 'Homepage', 'amigo' ), 'everywhere' => __( 'Everywhere', 'amigo' ), ), 'required' => array( array( 'setting' => 'get-carousel', 'operator' => '==', 'value' => 1, ), ) ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'switch', 'settings' => 'related-posts-check', 'label' => __( 'Related posts', 'amigo' ), 'description' => __( 'Enable or disable related posts', 'amigo' ), 'section' => 'post_section', 'default' => 1, 'priority' => 10, ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'switch', 'settings' => 'author-check', 'label' => __( 'Author box', 'amigo' ), 'description' => __( 'Enable or disable author box', 'amigo' ), 'section' => 'post_section', 'default' => 1, 'priority' => 10, ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'switch', 'settings' => 'post-nav-check', 'label' => __( 'Post navigation', 'amigo' ), 'description' => __( 'Enable or disable navigation below post content', 'amigo' ), 'section' => 'post_section', 'default' => 1, 'priority' => 10, ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'switch', 'settings' => 'breadcrumbs-check', 'label' => __( 'Breadcrumbs', 'amigo' ), 'description' => __( 'Enable or disable Breadcrumbs', 'amigo' ), 'section' => 'post_section', 'default' => 1, 'priority' => 10, ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'toggle', 'settings' => 'amigo_socials', 'label' => __( 'Social Icons', 'amigo' ), 'description' => __( 'Enable or Disable the social icons', 'amigo' ), 'section' => 'top_bar_section', 'default' => 0, 'priority' => 10, ) ); $s_social_links = array( 'twp_social_facebook' => __( 'Facebook', 'amigo' ), 'twp_social_twitter' => __( 'Twitter', 'amigo' ), 'twp_social_google' => __( 'Google-Plus' , 'amigo' ), 'twp_social_instagram' => __( 'Instagram', 'amigo' ), 'twp_social_pin' => __( 'Pinterest', 'amigo' ), 'twp_social_youtube' => __( 'YouTube', 'amigo' ), 'twp_social_reddit' => __( 'Reddit', 'amigo' ), ); foreach ( $s_social_links as $keys => $values ) { Kirki::add_field( 'amigo_settings', array( 'type' => 'text', 'settings' => $keys, 'label' => $values, 'description' => sprintf( __( 'Insert your custom link to show the %s icon.', 'amigo' ), $values ), 'help' => __( 'Leave blank to hide icon.', 'amigo' ), 'section' => 'top_bar_section', 'default' => '', 'priority' => 10, ) ); } Kirki::add_field( 'amigo_settings', array( 'type' => 'custom', 'settings' => 'main_color_title', 'label' => __( 'Main colors', 'amigo' ), 'section' => 'colors_section', 'default' => '
', 'priority' => 10, ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'color', 'settings' => 'main_site_color', 'label' => __( 'Main color', 'amigo' ), 'help' => __( 'Main site color.', 'amigo' ), 'section' => 'colors_section', 'default' => '#ff7f00', 'priority' => 10, 'output' => array( array( 'element' => '.pagination > li > a, i.post-icon.fa, .navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus, .navbar-inverse .navbar-nav > li > a:hover', 'property' => 'color', ), array( 'element' => '.first-textarea .widget, .featured-thumbnail:hover .archive-layer, .footer-pagination, #wp-calendar #prev a, #wp-calendar #next a, .comment-reply-link, .flex-caption .page-header:before, li.carousel-item:hover .carousel-layer, .btn-info, .comment-respond #submit, #searchform #searchsubmit, .time-info, #back-top span, .cat-meta', 'property' => 'background-color', ), array( 'element' => '#slidebox, .btn-info, .comment-respond #submit, #searchform #searchsubmit, blockquote, .comment-reply-link, #wp-calendar #prev a, #wp-calendar #next a, .rsrc-author-credits, .pagination > .active > span', 'property' => 'border-color', ), ), 'transport' => 'postMessage', 'js_vars' => array( array( 'element' => '.pagination > li > a, i.post-icon.fa, .navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus, .navbar-inverse .navbar-nav > li > a:hover', 'property' => 'color', 'function' => 'css', ), array( 'element' => '.first-textarea .widget, .featured-thumbnail:hover .archive-layer, .footer-pagination, #wp-calendar #prev a, #wp-calendar #next a, .comment-reply-link, .flex-caption .page-header:before, li.carousel-item:hover .carousel-layer, .btn-info, .comment-respond #submit, #searchform #searchsubmit, .time-info, #back-top span, .cat-meta', 'property' => 'background-color', 'function' => 'css', ), array( 'element' => '#slidebox, .btn-info, .comment-respond #submit, #searchform #searchsubmit, blockquote, .comment-reply-link, #wp-calendar #prev a, #wp-calendar #next a, .rsrc-author-credits, .pagination > .active > span', 'property' => 'border-color', 'function' => 'css', ), ), ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'color', 'settings' => 'body_color', 'label' => __( 'Body color', 'amigo' ), 'help' => __( 'Background color for pages and posts.', 'amigo' ), 'section' => 'colors_section', 'default' => '#fff', 'priority' => 10, 'output' => array( array( 'element' => '.search-head, .rsrc-main article, #slidebox, .rsrc-main .rsrc-post-content, i.post-icon.fa, .widget, #breadcrumbs, #content-footer-section, #content-footer-section .widget, .rsrc-author-credits', 'property' => 'background-color', ), ), 'transport' => 'postMessage', 'js_vars' => array( array( 'element' => '.search-head, .rsrc-main article, #slidebox, .rsrc-main .rsrc-post-content, i.post-icon.fa, .widget, #breadcrumbs, #content-footer-section, #content-footer-section .widget, .rsrc-author-credits', 'property' => 'background-color', 'function' => 'css', ), ), ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'color', 'settings' => 'links_color', 'label' => __( 'Links color', 'amigo' ), 'section' => 'colors_section', 'default' => '#898989', 'priority' => 10, 'output' => array( array( 'element' => 'a', 'property' => 'color', ), ), 'transport' => 'postMessage', 'js_vars' => array( array( 'element' => 'a', 'function' => 'css', 'property' => 'color', ), ), ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'color', 'settings' => 'links_hover_color', 'label' => __( 'Links hover color', 'amigo' ), 'section' => 'colors_section', 'default' => '#fc002a', 'priority' => 10, 'output' => array( array( 'element' => 'a:hover', 'property' => 'color', ), array( 'element' => '.btn-info:hover, .btn-info:focus, .btn-info.focus, .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info, .comment-respond #submit:hover, .comment-respond #submit:focus, .comment-respond #submit.focus, .comment-respond #submit:active, .comment-respond #submit.active, .open > .dropdown-toggle.comment-respond #submit, #searchform #searchsubmit:hover, #searchform #searchsubmit:focus, #searchform #searchsubmit.focus, #searchform #searchsubmit:active, #searchform #searchsubmit.active, .open > .dropdown-toggle#searchform #searchsubmit', 'property' => 'background-color', ), array( 'element' => '.btn-info:hover, .btn-info:focus, .btn-info.focus, .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info, .comment-respond #submit:hover, .comment-respond #submit:focus, .comment-respond #submit.focus, .comment-respond #submit:active, .comment-respond #submit.active, .open > .dropdown-toggle.comment-respond #submit, #searchform #searchsubmit:hover, #searchform #searchsubmit:focus, #searchform #searchsubmit.focus, #searchform #searchsubmit:active, #searchform #searchsubmit.active, .open > .dropdown-toggle#searchform #searchsubmit', 'property' => 'border-color', ), ), 'transport' => 'postMessage', 'js_vars' => array( array( 'element' => 'a:hover', 'property' => 'color', 'function' => 'css', ), array( 'element' => '.btn-info:hover, .btn-info:focus, .btn-info.focus, .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info, .comment-respond #submit:hover, .comment-respond #submit:focus, .comment-respond #submit.focus, .comment-respond #submit:active, .comment-respond #submit.active, .open > .dropdown-toggle.comment-respond #submit, #searchform #searchsubmit:hover, #searchform #searchsubmit:focus, #searchform #searchsubmit.focus, #searchform #searchsubmit:active, #searchform #searchsubmit.active, .open > .dropdown-toggle#searchform #searchsubmit', 'property' => 'background-color', 'function' => 'css', ), array( 'element' => '.btn-info:hover, .btn-info:focus, .btn-info.focus, .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info, .comment-respond #submit:hover, .comment-respond #submit:focus, .comment-respond #submit.focus, .comment-respond #submit:active, .comment-respond #submit.active, .open > .dropdown-toggle.comment-respond #submit, #searchform #searchsubmit:hover, #searchform #searchsubmit:focus, #searchform #searchsubmit.focus, #searchform #searchsubmit:active, #searchform #searchsubmit.active, .open > .dropdown-toggle#searchform #searchsubmit', 'property' => 'border-color', 'function' => 'css', ), ), ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'custom', 'settings' => 'typo_title', 'label' => __( 'Typography and font colors', 'amigo' ), 'section' => 'colors_section', 'default' => '
', 'priority' => 10, ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'color', 'settings' => 'color_site_title', 'label' => __( 'Site title color', 'amigo' ), 'help' => __( 'Site title text color, if not defined logo.', 'amigo' ), 'section' => 'colors_section', 'default' => '#fff', 'priority' => 10, 'output' => array( array( 'element' => 'h2.site-title a, h1.site-title a', 'property' => 'color', 'units' => ' !important', ), ), ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'typography', 'settings' => 'site_title_typography_font', 'label' => __( 'Site title font', 'amigo' ), 'section' => 'colors_section', 'default' => array( 'font-style' => array( 'bold', 'italic' ), 'font-family' => 'Erica One', 'font-size' => '36', 'font-weight' => '500', 'line-height' => '1.1', 'letter-spacing' => '0', ), 'priority' => 10, 'choices' => array( 'font-style' => true, 'font-family' => true, 'font-size' => true, 'font-weight' => true, 'line-height' => true, 'letter-spacing' => true, 'units' => array( 'px' ), ), 'output' => array( array( 'element' => 'h2.site-title, h1.site-title', ), ), ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'color', 'settings' => 'color_content_text', 'label' => __( 'Text color', 'amigo' ), 'help' => __( 'Select the general text color used in the theme.', 'amigo' ), 'section' => 'colors_section', 'default' => '#4D4D4D', 'priority' => 10, 'output' => array( array( 'element' => 'body, .entry-summary, .info-reviews', 'property' => 'color', ), ), ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'typography', 'settings' => 'content_typography_font', 'label' => __( 'Site content font', 'amigo' ), 'section' => 'colors_section', 'default' => array( 'font-style' => array( 'bold', 'italic' ), 'font-family' => 'Roboto', 'font-size' => '14', 'font-weight' => '300', 'line-height' => '1.8', 'letter-spacing' => '0.5', ), 'priority' => 10, 'choices' => array( 'font-style' => true, 'font-family' => true, 'font-size' => true, 'font-weight' => true, 'line-height' => true, 'letter-spacing' => true, 'units' => array( 'px' ), ), 'output' => array( array( 'element' => 'body, .entry-summary, .btn-primary.outline', ), ), ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'color', 'settings' => 'color_headings', 'label' => __( 'Headings color', 'amigo' ), 'help' => __( 'Select the general text color used in the theme.', 'amigo' ), 'section' => 'colors_section', 'default' => '#3d3d3d', 'priority' => 10, 'output' => array( array( 'element' => '.home-header .page-header a, .page-header, .page-header a', 'property' => 'color', ), ), ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'typography', 'settings' => 'headings_typography_font', 'label' => __( 'Headings font', 'amigo' ), 'section' => 'colors_section', 'default' => array( 'font-style' => array( 'bold', 'italic' ), 'font-family' => 'Oswald', 'font-size' => '30', 'font-weight' => '700', 'line-height' => '1.1', 'letter-spacing' => '4', ), 'priority' => 10, 'choices' => array( 'font-style' => true, 'font-family' => true, 'font-size' => true, 'font-weight' => true, 'line-height' => true, 'letter-spacing' => true, 'units' => array( 'px' ), ), 'output' => array( array( 'element' => '.home-header .page-header a, .page-header, .page-header a', ), ), ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'color', 'settings' => 'color_widget_titles', 'label' => __( 'Widget titles color', 'amigo' ), 'section' => 'colors_section', 'default' => '#3d3d3d', 'priority' => 10, 'output' => array( array( 'element' => 'h3.widget-title', 'property' => 'color', ), ), ) ); Kirki::add_field( 'amigo_settings', array( 'type' => 'background', 'settings' => 'background_site', 'label' => __( 'Background', 'amigo' ), 'section' => 'site_bg_section', 'default' => array( 'color' => '#424242', 'image' => '', 'repeat' => 'no-repeat', 'size' => 'cover', 'attach' => 'fixed', 'position' => 'center-top', 'opacity' => 100, ), 'priority' => 10, 'output' => 'body', ) ); } /** * Configuration sample for the amigo Customizer. */ function amigo_configuration_sample( $config ) { $config['logo_image'] = get_template_directory_uri() . '/img/logo.png'; $config['description'] = __( 'amigo is a simple way to create your Personal WordPress Blog or Magazine, with no technical knowledge or expertise required.', 'amigo' ); $config['color_back'] = '#192429'; $config['width'] = '25%'; return $config; } add_filter( 'kirki/config', 'amigo_configuration_sample' ); function amigo_configuration_i18n( $config ) { $strings = array( 'background-color' => __( 'Background Color', 'amigo' ), 'background-image' => __( 'Background Image', 'amigo' ), 'no-repeat' => __( 'No Repeat', 'amigo' ), 'repeat-all' => __( 'Repeat All', 'amigo' ), 'repeat-x' => __( 'Repeat Horizontally', 'amigo' ), 'repeat-y' => __( 'Repeat Vertically', 'amigo' ), 'inherit' => __( 'Inherit', 'amigo' ), 'background-repeat' => __( 'Background Repeat', 'amigo' ), 'cover' => __( 'Cover', 'amigo' ), 'contain' => __( 'Contain', 'amigo' ), 'background-size' => __( 'Background Size', 'amigo' ), 'fixed' => __( 'Fixed', 'amigo' ), 'scroll' => __( 'Scroll', 'amigo' ), 'background-attachment' => __( 'Background Attachment', 'amigo' ), 'left-top' => __( 'Left Top', 'amigo' ), 'left-center' => __( 'Left Center', 'amigo' ), 'left-bottom' => __( 'Left Bottom', 'amigo' ), 'right-top' => __( 'Right Top', 'amigo' ), 'right-center' => __( 'Right Center', 'amigo' ), 'right-bottom' => __( 'Right Bottom', 'amigo' ), 'center-top' => __( 'Center Top', 'amigo' ), 'center-center' => __( 'Center Center', 'amigo' ), 'center-bottom' => __( 'Center Bottom', 'amigo' ), 'background-position' => __( 'Background Position', 'amigo' ), 'background-opacity' => __( 'Background Opacity', 'amigo' ), 'ON' => __( 'ON', 'amigo' ), 'OFF' => __( 'OFF', 'amigo' ), 'all' => __( 'All', 'amigo' ), 'cyrillic' => __( 'Cyrillic', 'amigo' ), 'cyrillic-ext' => __( 'Cyrillic Extended', 'amigo' ), 'devanagari' => __( 'Devanagari', 'amigo' ), 'greek' => __( 'Greek', 'amigo' ), 'greek-ext' => __( 'Greek Extended', 'amigo' ), 'khmer' => __( 'Khmer', 'amigo' ), 'latin' => __( 'Latin', 'amigo' ), 'latin-ext' => __( 'Latin Extended', 'amigo' ), 'vietnamese' => __( 'Vietnamese', 'amigo' ), 'serif' => _x( 'Serif', 'font style', 'amigo' ), 'sans-serif' => _x( 'Sans Serif', 'font style', 'amigo' ), 'monospace' => _x( 'Monospace', 'font style', 'amigo' ), ); $config['i18n'] = $strings; return $config; } add_filter( 'kirki/config', 'amigo_configuration_i18n' );