get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'custom_logo' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '#alogo', 'render_callback' => function(){ bloginfo( 'name' ); }, ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => function(){ bloginfo( 'description' ); }, ) ); } ); function awada_render_footer_copyright(){ $awada_theme_options = awada_theme_options(); echo '
'; } function awada_partial_refresh_callout_btn(){ $awada_theme_options = awada_theme_options(); echo ''.$awada_theme_options['callout_btn_text'].''; } function awada_render_contact_email(){ $awada_theme_options = awada_theme_options(); $out = ' '.$awada_theme_options['contact_email'].''; return $out; } function awada_render_contact_phone(){ $awada_theme_options = awada_theme_options(); $out = ' '.$awada_theme_options['contact_phone']; return $out; } /* Add Customizer Panel */ $awada_theme_options = awada_theme_options(); Kirki::add_config('awada_theme', array( 'capability' => 'edit_theme_options', 'option_type' => 'option', 'option_name' => 'awada_theme_options', )); Kirki::add_panel('awada_option_panel', array( 'priority' => 10, 'title' => __('Awada Options', 'awada'), 'description' => __('Here you can customize all your site contents', 'awada'), )); Kirki::add_field('awada_theme', array( 'settings' => 'header_topbar_bg_color', 'label' => __('Header Top Bar Background Color', 'awada'), 'description' => __('Change Top bar Background Color', 'awada'), 'section' => 'colors', 'type' => 'color', 'priority' => 9, 'default' => '#33a568', 'sanitize_callback' => 'awada_sanitize_color', 'output' => array( array( 'element' => '#sitetopbar', 'property' => 'background', ), array( 'element' => '#sitetopbar', 'property' => 'border-bottom', ), ), 'transport' => 'auto', )); Kirki::add_field('awada_theme', array( 'settings' => 'header_topbar_color', 'label' => __('Header Top Bar Text Color', 'awada'), 'description' => __('Change Top bar Font/Content Color', 'awada'), 'section' => 'colors', 'type' => 'color', 'priority' => 9, 'default' => '#fff', 'sanitize_callback' => 'awada_sanitize_color', 'output' => array( array( 'element' => '#sitetopbar, #sitetopbar a', 'property' => 'color', ), ), 'transport' => 'auto', )); Kirki::add_field('awada_theme', array( 'settings' => 'header_background_color', 'label' => __('Header Background Color', 'awada'), 'description' => __('Change Header Background Color', 'awada'), 'section' => 'colors', 'type' => 'color', 'priority' => 9, 'default' => '#fff', 'sanitize_callback' => 'awada_sanitize_color', 'output' => array( array( 'element' => '#awada-header, #awada-header .navbar', 'property' => 'background', ), array( 'element' => '.arrow-up', 'property' => 'border-bottom', ), ), 'transport' => 'auto', )); Kirki::add_field('awada_theme', array( 'settings' => 'header_textcolor', 'label' => __('Header Text Color', 'awada'), 'description' => __('Change Header Text Color', 'awada'), 'section' => 'colors', 'type' => 'color', 'priority' => 9, 'default' => '#222222', 'sanitize_callback' => 'awada_sanitize_color', 'output' => array( array( 'element' => '.navbar-default .navbar-brand, #awada-header .navbar-nav > li > a, .dropdown-menu > li > a,.site-title a, .site-description', 'property' => 'color', ), ), 'transport' => 'auto', )); Kirki::add_section('general_sec', array( 'title' => __('General Options', 'awada'), 'description' => __('Here you can change basic settings of your site', 'awada'), 'panel' => 'awada_option_panel', 'priority' => 158, 'capability' => 'edit_theme_options', )); Kirki::add_field( 'awada_theme', array( 'type' => 'preset', 'settings' => 'color_scheme', 'label' => __( 'Color Scheme', 'awada' ), 'section' => 'general_sec', 'default' => 'green.css', 'priority' => 10, 'choices' => array( 'default.css' => array( 'label' => __('Default','awada'), 'settings' => array( 'awada_theme_options[header_topbar_bg_color]' => '#31a3dd', ), ), 'green.css' => array( 'label' => __('Green','awada'), 'settings' => array( 'awada_theme_options[header_topbar_bg_color]' => '#33a568', ), ), 'DonJuan.css' => array( 'label' => __('Coffee','awada'), 'settings' => array( 'awada_theme_options[header_topbar_bg_color]' => '#5C4B51', ), ), ), ) ); Kirki::add_field('awada_theme', array( 'settings' => 'logo_top_spacing', 'label' => __('Logo Top Spacing', 'awada'), 'section' => 'title_tagline', 'type' => 'slider', 'priority' => 40, 'default' => 0, 'choices' => array( 'max' => 50, 'min' => -50, 'step' => 1, ), 'transport' => 'auto', 'output' => array( array( 'element' => '#awada-header .dropmenu img', 'property' => 'margin-top', 'units' => 'px', ), array( 'element' => '#awada-header .site-branding-text', 'property' => 'margin-top', 'units' => 'px', ), ), 'sanitize_callback' => 'awada_sanitize_number', )); /* Typography */ Kirki::add_section('typography_sec', array( 'title' => __('Typography Section', 'awada'), 'description' => __('Here you can change Font Style of your site', 'awada'), 'panel' => 'awada_option_panel', 'priority' => 160, 'capability' => 'edit_theme_options', )); Kirki::add_field('awada_theme', array( 'type' => 'typography', 'settings' => 'logo_font', 'label' => __('Logo Font Style', 'awada'), 'description' => __('Change logo font family and font style.', 'awada'), 'section' => 'typography_sec', 'default' => array( 'font-style' => array('bold', 'italic'), 'font-family' => 'Eagle Lake', 'font-size' => '28px', ), 'priority' => 10, 'choices' => array( 'font-style' => true, 'font-family' => true, 'font-size' => true, 'line-height' => true, 'font-weight' => true, ), 'output' => array( array( 'element' => '#awada-header .site-branding-text h1, #awada-header .site-branding-text p.site-title', ), ), )); Kirki::add_field('awada_theme', array( 'type' => 'typography', 'settings' => 'logo_sub_font', 'label' => __('Logo Subtitle/Description Font Style', 'awada'), 'description' => __('Change logo Subtitle/Description font family and font style.', 'awada'), 'section' => 'typography_sec', 'default' => array( 'font-style' => array('bold', 'italic'), 'font-family' => 'Eagle Lake', 'font-size' => '14px', ), 'priority' => 10, 'choices' => array( 'font-style' => true, 'font-family' => true, 'font-size' => true, 'line-height' => true, 'font-weight' => true, ), 'output' => array( array( 'element' => '#awada-header .site-branding-text p.site-description', ), ), )); Kirki::add_field('awada_theme', array( 'type' => 'typography', 'settings' => 'menu_font', 'label' => __('Menu Font Style', 'awada'), 'description' => __('Change Primary Menu font family and font style.', 'awada'), 'section' => 'typography_sec', 'default' => array( 'font-style' => array('bold', 'italic'), 'font-family' => "Merriweather","Georgia", "serif", ), 'priority' => 10, 'choices' => array( 'font-style' => true, 'font-family' => true, 'font-size' => true, 'line-height' => true, 'font-weight' => true, ), 'output' => array( array( 'element' => '#awada-header .navbar-nav > li > a', ), ), )); /* Full body typography */ Kirki::add_field('awada_theme', array( 'type' => 'typography', 'settings' => 'site_font', 'label' => __('Site Font Style', 'awada'), 'description' => __('Change whole site font family and font style.', 'awada'), 'section' => 'typography_sec', 'default' => array( 'font-style' => array('bold', 'italic'), 'font-family' => "Merriweather","Georgia", "serif", ), 'priority' => 10, 'choices' => array( 'font-style' => true, 'font-family' => true, ), 'output' => array( array( 'element' => 'body, h1, h2, h3, h4, h5, h6, p, em, blockquote', ), ), )); /* Home title typography */ Kirki::add_field('awada_theme', array( 'type' => 'typography', 'settings' => 'site_title_font', 'label' => __('Home Sections Title Font', 'awada'), 'description' => __('Change font style of home service, home portfolio, home blog', 'awada'), 'section' => 'typography_sec', 'default' => array( 'font-style' => array('bold', 'italic'), 'font-family' => "Merriweather","Georgia", "serif", ), 'priority' => 10, 'choices' => array( 'font-style' => true, 'font-family' => true, 'font-size' => true, 'line-height' => true, 'font-weight' => true, ), 'output' => array( array( 'element' => '.main_title h2', ), ), )); /* Layout section */ Kirki::add_section('layout_sec', array( 'title' => __('Layout Options', 'awada'), 'description' => __('Here you can change Layout and basic design of your site', 'awada'), 'panel' => 'awada_option_panel', 'priority' => 160, 'capability' => 'edit_theme_options', 'transport' => 'postMessage', )); Kirki::add_field('awada_theme', array( 'type' => 'toggle', 'settings' => 'headersticky', 'label' => __('Fixed Header', 'awada'), 'description' => __('Switch between fixed and static header', 'awada'), 'section' => 'layout_sec', 'default' => $awada_theme_options['headersticky'], 'priority' => 10, 'sanitize_callback' => 'awada_sanitize_checkbox', )); Kirki::add_field('awada_theme', array( 'settings' => 'site_layout', 'label' => __('Site Layout', 'awada'), 'description' => __('Change your site layout to full width or boxed size.', 'awada'), 'section' => 'layout_sec', 'type' => 'radio-image', 'priority' => 10, 'default' => '', 'sanitize_callback' => 'awada_sanitize_text', 'choices' => array( '' => get_template_directory_uri() . '/images/layout/1c.png', 'boxed' => get_template_directory_uri() . '/images/layout/3cm.png', ), )); Kirki::add_field('awada_theme', array( 'settings' => 'footer_layout', 'label' => __('Footer Layout', 'awada'), 'description' => __('Change footer into 2, 3 or 4 column', 'awada'), 'section' => 'layout_sec', 'type' => 'radio-image', 'priority' => 10, 'default' => $awada_theme_options['footer_layout'], 'transport' => 'postMessage', 'choices' => array( 2 => get_template_directory_uri() . '/images/layout/footer-widgets-2.png', 3 => get_template_directory_uri() . '/images/layout/footer-widgets-3.png', 4 => get_template_directory_uri() . '/images/layout/footer-widgets-4.png', ), 'sanitize_callback' => 'awada_sanitize_number', )); Kirki::add_field('awada_theme', array( 'settings' => 'blog_layout', 'label' => __('Blog Post Layout', 'awada'), 'description' => __('Select Blog Layout', 'awada'), 'help' => __('With this option you can select blog left sidebar,right sidebar and full width', 'awada'), 'section' => 'layout_sec', 'type' => 'radio-image', 'priority' => 10, 'default' => $awada_theme_options['blog_layout'], 'choices' => array( 'rightsidebar' => get_template_directory_uri() . '/images/layout/2cr.png', 'leftsidebar' => get_template_directory_uri() . '/images/layout/2cl.png', 'fullwidth' => get_template_directory_uri() . '/images/layout/1c.png', ), 'sanitize_callback' => 'awada_sanitize_text', )); Kirki::add_field('awada_theme', array( 'settings' => 'post_layout', 'label' => __('Single Post Layout', 'awada'), 'description' => __('Select Post Layout', 'awada'), 'help' => __('With this option you can select single post with left sidebar,right sidebar and full width', 'awada'), 'section' => 'layout_sec', 'type' => 'radio-image', 'priority' => 10, 'default' => $awada_theme_options['post_layout'], 'choices' => array( 'leftsidebar' => get_template_directory_uri() . '/images/layout/2cl.png', 'rightsidebar' => get_template_directory_uri() . '/images/layout/2cr.png', 'fullwidth' => get_template_directory_uri() . '/images/layout/1c.png', ), 'sanitize_callback' => 'awada_sanitize_text', )); Kirki::add_field('awada_theme', array( 'settings' => 'page_layout', 'label' => __('Page Layout', 'awada'), 'description' => __('Select Page Layout', 'awada'), 'help' => __('With this option you can select page with left sidebar,right sidebar and full width', 'awada'), 'section' => 'layout_sec', 'type' => 'radio-image', 'priority' => 10, 'default' => $awada_theme_options['page_layout'], 'choices' => array( 'leftsidebar' => get_template_directory_uri() . '/images/layout/2cl.png', 'rightsidebar' => get_template_directory_uri() . '/images/layout/2cr.png', 'fullwidth' => get_template_directory_uri() . '/images/layout/1c.png', ), 'sanitize_callback' => 'awada_sanitize_text', )); /* Slider */ Kirki::add_section('slider_sec', array( 'title' => __('Slider Options', 'awada'), 'description' => __('Change slider text(s) and images', 'awada'), 'panel' => 'awada_option_panel', 'priority' => 160, 'capability' => 'edit_theme_options', )); Kirki::add_field('awada_theme', array( 'settings' => 'home_slider_enabled', 'label' => __('Enable Home Slider', 'awada'), 'section' => 'slider_sec', 'type' => 'switch', 'priority' => 10, 'default' => 1, 'transport' => 'postMessage', 'sanitize_callback' => 'awada_sanitize_checkbox', )); $num = array(1 => 'One', 2 => 'Two', 3 => 'Three'); for ($i = 1; $i <= 3; $i++) { Kirki::add_field('awada_theme', array( 'settings' => 'slider_heading_' . $i, 'label' => sprintf(__('Slider %s', 'awada'), $num[$i]), 'section' => 'slider_sec', 'type' => 'heading', 'priority' => 10, 'sanitize_callback' => 'awada_sanitize_text', )); Kirki::add_field('awada_theme', array( 'settings' => 'slider_img_' . $i, 'label' => sprintf(__('Slider %s Image', 'awada'), $num[$i]), 'description' => __('Recommended image size is 1600x500px', 'awada'), 'type' => 'image', 'section' => 'slider_sec', 'priority' => 10, 'default' => get_template_directory_uri() . '/images/slider/s'.$i.'.jpg', )); Kirki::add_field('awada_theme', array( 'settings' => 'slider_title_' . $i, 'label' => sprintf(__('Slider %s Title', 'awada'), $num[$i]), 'type' => 'text', 'default' => $awada_theme_options['slider_title_' . $i], 'section' => 'slider_sec', 'priority' => 10, 'sanitize_callback' => 'awada_sanitize_text', )); Kirki::add_field('awada_theme', array( 'settings' => 'slider_subtitle_' . $i, 'label' => sprintf(__('Slider %s Subitle', 'awada'), $num[$i]), 'type' => 'text', 'default' => $awada_theme_options['slider_subtitle_' . $i], 'section' => 'slider_sec', 'priority' => 10, 'sanitize_callback' => 'awada_sanitize_text', )); Kirki::add_field('awada_theme', array( 'type' => 'radio-buttonset', 'settings' => 'slider_post_page_' . $i, 'label' => __('Link this slide to a post or page', 'awada'), 'section' => 'slider_sec', 'default' => 'post', 'priority' => 10, 'choices' => array( 'post' => esc_attr__('Post', 'awada'), 'page' => esc_attr__('Page', 'awada'), ), )); Kirki::add_field('awada_theme', array( 'type' => 'select', 'settings' => 'post_slider_' . $i, 'label' => __('Select a post', 'awada'), 'section' => 'slider_sec', 'priority' => 10, 'choices' => Kirki_Helper::get_posts(array('posts_per_page' => -1, 'orderby' => 'date', 'order' => 'DESC', 'post_type' => 'post', 'post_status' => 'publish')), 'active_callback' => array( array( 'setting' => 'slider_post_page_' . $i, 'operator' => '==', 'value' => 'post', ), ), )); Kirki::add_field('awada_theme', array( 'settings' => 'page_slider_' . $i, 'label' => __('Select a page', 'awada'), 'type' => 'dropdown-pages', 'section' => 'slider_sec', 'priority' => 10, 'sanitize_callback' => 'awada_sanitize_number', 'active_callback' => array( array( 'setting' => 'slider_post_page_' . $i, 'operator' => '==', 'value' => 'page', ), ), )); Kirki::add_field('awada_theme', array( 'settings' => 'slider_readmore_' . $i, 'label' => __('Read more button text', 'awada'), 'type' => 'text', 'section' => 'slider_sec', 'priority' => 10, 'default' => __('Read More', 'awada'), 'sanitize_callback' => 'awada_sanitize_text', 'active_callback' => function () use ($i) { $awada_options = get_option('awada_theme_options'); if (isset($awada_options['slider_post_page_' . $i]) && $awada_options['slider_post_page_' . $i] == 'post') { if (isset($awada_options['post_slider_' . $i]) && $awada_options['post_slider_' . $i] != 0) {return true;} } else { if (isset($awada_options['page_slider_' . $i]) && $awada_options['page_slider_' . $i] != 0) {return true;} } return false; }, )); } Kirki::add_field('awada_theme', array( 'settings' => 'slider_plugin_heading', 'label' => __('Or Put Slider Plugin Shortcode here', 'awada'), 'section' => 'slider_sec', 'type' => 'heading', 'priority' => 10, 'sanitize_callback' => 'awada_sanitize_text', )); Kirki::add_field('awada_theme', array( 'type' => 'text', 'settings' => 'home_slider_shortcode', 'label' => __('Plugin Shortcode', 'awada'), 'section' => 'slider_sec', 'priority' => 10, 'text' => 'awada_sanitize_text', )); /* Service Options */ Kirki::add_section('service_sec', array( 'title' => __('Service Options', 'awada'), 'panel' => 'awada_option_panel', 'priority' => 160, 'capability' => 'edit_theme_options', )); Kirki::add_field('awada_theme', array( 'settings' => 'home_service_title', 'label' => __('Home Service Heading', 'awada'), 'section' => 'service_sec', 'type' => 'text', 'priority' => 10, 'transport' => 'postMessage', 'default' => $awada_theme_options['home_service_title'], 'sanitize_callback' => 'awada_sanitize_text', 'partial_refresh' => array( 'home_service_title' => array( 'selector' => '#home_service_title', 'render_callback' => function(){$awada_theme_options = awada_theme_options(); return $awada_theme_options['home_service_title'];} ), ) )); Kirki::add_field('awada_theme', array( 'settings' => 'home_service_description', 'label' => __('Home Service Description', 'awada'), 'section' => 'service_sec', 'type' => 'textarea', 'priority' => 10, 'transport' => 'postMessage', 'default' => $awada_theme_options['home_service_description'], 'sanitize_callback' => 'awada_sanitize_textarea', 'partial_refresh' => array( 'home_service_description' => array( 'selector' => '#home_service_description', 'render_callback' => function(){$awada_theme_options = awada_theme_options(); return $awada_theme_options['home_service_description'];} ), ) )); Kirki::add_field('awada_theme', array( 'settings' => 'home_service_column', 'label' => __('Home Service Column', 'awada'), 'section' => 'service_sec', 'type' => 'select', 'priority' => 10, 'default' => 4, 'choices' => array( 2 => __('Two Column', 'awada'), 3 => __('Three Column', 'awada'), 4 => __('Four Column', 'awada'), ), 'sanitize_callback' => 'awada_sanitize_number', )); for($i=1;$i<=4;$i++){ $num = array(1=>'One', 2=>'Two', 3=>'Three',4=>'Four'); Kirki::add_field('awada_theme', array( 'settings' => 'service_icon_'.$i, 'label' => sprintf(__('Service %s Icon','awada'), $num[$i]), 'section' => 'service_sec', 'type' => 'fontawesome', 'priority' => 10, 'transport' => 'postMessage', 'default' => $awada_theme_options['service_icon_'.$i], 'sanitize_callback' => 'awada_sanitize_text', 'partial_refresh' => array( 'service_icon_'.$i => array( 'selector' => '#service_box_'.$i, 'render_callback' => function() use($i){$awada_theme_options = awada_theme_options(); return $awada_theme_options['service_icon_'.$i];} ), ) )); Kirki::add_field('awada_theme', array( 'settings' => 'service_title_'.$i, 'label' => sprintf(__('Service %s Title','awada'), $num[$i]), 'section' => 'service_sec', 'type' => 'text', 'priority' => 10, 'transport' => 'postMessage', 'default' => $awada_theme_options['service_title_'.$i], 'sanitize_callback' => 'awada_sanitize_text', 'partial_refresh' => array( 'service_title_'.$i => array( 'selector' => '#service_title_'.$i, 'render_callback' => function() use($i){$awada_theme_options = awada_theme_options(); return $awada_theme_options['service_title_'.$i];} ), ) )); Kirki::add_field('awada_theme', array( 'settings' => 'service_text_'.$i, 'label' => sprintf(__('Service %s Description','awada'), $num[$i]), 'section' => 'service_sec', 'type' => 'textarea', 'priority' => 10, 'transport' => 'postMessage', 'default' => $awada_theme_options['service_text_'.$i], 'sanitize_callback' => 'awada_sanitize_textarea', 'partial_refresh' => array( 'service_text_'.$i => array( 'selector' => '#service_text_'.$i, 'render_callback' => function() use($i){$awada_theme_options = awada_theme_options(); return $awada_theme_options['service_text_'.$i];} ), ) )); Kirki::add_field('awada_theme', array( 'settings' => 'service_link_'.$i, 'label' => sprintf(__('Service %s URL','awada'), $num[$i]), 'section' => 'service_sec', 'type' => 'text', 'priority' => 10, 'transport' => 'postMessage', 'default' => $awada_theme_options['service_link_'.$i], 'sanitize_callback' => 'esc_url', 'partial_refresh' => array( 'service_link_'.$i => array( 'selector' => '#service_link_'.$i, 'render_callback' => function() use($i){$awada_theme_options = awada_theme_options(); return $awada_theme_options['service_link_'.$i];} ), ) )); } /* Portfolio */ Kirki::add_section('portfolio_sec', array( 'title' => __('Portfolio Options', 'awada'), 'panel' => 'awada_option_panel', 'priority' => 160, 'capability' => 'edit_theme_options', )); Kirki::add_field('awada_theme', array( 'settings' => 'home_portfolio_title', 'label' => __('Portfolio Title', 'awada'), 'section' => 'portfolio_sec', 'type' => 'text', 'priority' => 10, 'transport' => 'postMessage', 'default' => $awada_theme_options['home_portfolio_title'], 'sanitize_callback' => 'awada_sanitize_text', 'partial_refresh' => array( 'home_portfolio_title' => array( 'selector' => '#portfolio_heading', 'render_callback' => function(){$awada_theme_options = awada_theme_options(); return $awada_theme_options['home_portfolio_title'];} ), ) )); Kirki::add_field('awada_theme', array( 'settings' => 'home_portfolio_subtitle', 'label' => __('Portfolio Subtitle', 'awada'), 'section' => 'portfolio_sec', 'type' => 'textarea', 'priority' => 10, 'transport' => 'postMessage', 'default' => $awada_theme_options['home_portfolio_subtitle'], 'sanitize_callback' => 'awada_sanitize_textarea', 'partial_refresh' => array( 'home_portfolio_subtitle' => array( 'selector' => '#portfolio_sub_heading', 'render_callback' => function(){$awada_theme_options = awada_theme_options(); return $awada_theme_options['home_portfolio_subtitle'];} ), ) )); Kirki::add_field('awada_theme', array( 'settings' => 'portfolio_post', 'label' => __('Select a post', 'awada'), 'description' => __('Select the post in which you have put shortcode.', 'awada'), 'section' => 'portfolio_sec', 'type' => 'select', 'priority' => 10, 'choices' => Kirki_Helper::get_posts(array('posts_per_page' => -1, 'orderby' => 'date', 'order' => 'DESC', 'post_type' => 'post', 'post_status' => 'publish')), 'sanitize_callback' => 'awada_sanitize_number', )); /* Blog Options */ Kirki::add_section('blog_sec', array( 'title' => __('Blog Options', 'awada'), 'panel' => 'awada_option_panel', 'priority' => 160, 'capability' => 'edit_theme_options', )); Kirki::add_field('awada_theme', array( 'settings' => 'home_blog_title', 'label' => __('Home Blog Title', 'awada'), 'section' => 'blog_sec', 'type' => 'text', 'priority' => 10, 'transport' => 'postMessage', 'default' => $awada_theme_options['home_blog_title'], 'sanitize_callback' => 'awada_sanitize_text', 'partial_refresh' => array( 'home_blog_title' => array( 'selector' => '#blog_heading', 'render_callback' => function(){$awada_theme_options = awada_theme_options(); return $awada_theme_options['home_blog_title'];} ), ) )); Kirki::add_field('awada_theme', array( 'settings' => 'home_blog_description', 'label' => __('Home Blog Description', 'awada'), 'section' => 'blog_sec', 'type' => 'textarea', 'priority' => 10, 'transport' => 'postMessage', 'default' => $awada_theme_options['home_blog_description'], 'sanitize_callback' => 'awada_sanitize_textarea', 'partial_refresh' => array( 'home_blog_description' => array( 'selector' => '#blog_description', 'render_callback' => function(){$awada_theme_options = awada_theme_options(); return $awada_theme_options['home_blog_description'];} ), ) )); Kirki::add_field('awada_theme', array( 'settings' => 'blog_post_count', 'label' => __('Blog Load More Posts', 'awada'), 'description' => __('Show Posts On Blog Home', 'awada'), 'help' => __('With this option you can show blog posts according your requirement', 'awada'), 'section' => 'blog_sec', 'type' => 'number', 'priority' => 10, 'transport' => 'postMessage', 'default' => 3, 'choices' => array( 'min' => 3, 'max' => 30, 'step' => 1, ), 'sanitize_callback' => 'awada_sanitize_number', )); Kirki::add_field('awada_theme', array( 'settings' => 'home_post_cat', 'label' => __('Category', 'awada'), 'description' => __('Show Posts On Home Blog According to Selected Categories', 'awada'), 'tooltip' => __('With this option you can show blog posts according your requirement', 'awada'), 'section' => 'blog_sec', 'type' => 'select', 'transport' => 'postMessage', 'priority' => 10, 'default' => array(), 'multiple' => 1, 'choices' => Kirki_Helper::get_terms( array('taxonomy' => 'category') ), 'sanitize_callback' => 'awada_sanitize_number', )); Kirki::add_field('awada_theme', array( 'settings' => 'show_load_more_btn', 'label' => __('Show Load More Button.', 'awada'), 'section' => 'blog_sec', 'type' => 'switch', 'priority' => 10, 'default' => 1, 'choices' => array( 'on' => __('Yes','awada'), 'off' => __('No','awada'), ), 'sanitize_callback'=>'awada_sanitize_checkbox' )); Kirki::add_field('awada_theme', array( 'settings' => 'home_load_post_num', 'label' => __('Number of load more posts.', 'awada'), 'description' => __('Number of posts you want to load on "Load More" button click', 'awada'), 'section' => 'blog_sec', 'type' => 'number', 'priority' => 10, 'default' => 3, 'choices' => array( 'min' => 3, 'max' => 10, 'step' => 1, ), 'sanitize_callback'=>'awada_sanitize_number', 'active_callback'=>array( array( 'setting' => 'show_load_more_btn', 'operator' => '==', 'value' => true, ), ) )); Kirki::add_field('awada_theme', array( 'settings' => 'blog_string', 'label' => __('Strings Used in Home Blog section', 'awada'), 'section' => 'blog_sec', 'type' => 'heading', 'priority' => 10, 'sanitize_callback' => 'awada_sanitize_text', )); Kirki::add_field('awada_theme', array( 'settings' => 'blog_load_more_text', 'label' => __('Load More Text', 'awada'), 'section' => 'blog_sec', 'type' => 'text', 'default' =>$awada_theme_options['blog_load_more_text'], 'priority' => 10, 'sanitize_callback' => 'awada_sanitize_text', )); Kirki::add_field('awada_theme', array( 'settings' => 'blog_more_loading', 'label' => __('Loading Text', 'awada'), 'section' => 'blog_sec', 'type' => 'text', 'default' =>$awada_theme_options['blog_more_loading'], 'priority' => 10, 'sanitize_callback' => 'awada_sanitize_text', )); Kirki::add_field('awada_theme', array( 'settings' => 'blog_no_more_post', 'label' => __('No more post Text', 'awada'), 'section' => 'blog_sec', 'type' => 'text', 'default' =>$awada_theme_options['blog_no_more_post'], 'priority' => 10, 'sanitize_callback' => 'awada_sanitize_text', )); /* Footer Callout */ Kirki::add_section('callout_sec', array( 'title' => __('Callout Options', 'awada'), 'panel' => 'awada_option_panel', 'priority' => 160, 'capability' => 'edit_theme_options', )); Kirki::add_field('awada_theme', array( 'settings' => 'callout_bg_image', 'label' => __('Banner Background Image', 'awada'), 'section' => 'callout_sec', 'type' => 'image', 'priority' => 10, 'transport' => 'postMessage', 'default' => $banner_img, 'sanitize_callback' => 'esc_url_raw', 'partial_refresh' => array( 'callout_bg_image' => array( 'selector' => '#awada_video', 'container_inclusive' => true, 'render_callback' => function(){ get_template_part('home-callout'); } ) ), )); Kirki::add_field('awada_theme', array( 'settings' => 'callout_external_bg_video', 'label' => __('Or, enter a YouTube URL:', 'awada'), 'section' => 'callout_sec', 'type' => 'text', 'priority' => 10, 'transport' => 'postMessage', 'default' => esc_url('https://www.youtube.com/watch?v=jnLSYfObARA'), 'sanitize_callback' => 'esc_url_raw', 'partial_refresh' => array( 'callout_external_bg_video' => array( 'selector' => '#awada_video', 'container_inclusive' => true, 'render_callback' => function(){ get_template_part('home-callout'); } ) ), )); Kirki::add_field('awada_theme', array( 'settings' => 'callout_bg_video_opt', 'section' => 'callout_sec', 'type' => 'custom', 'priority' => 10, 'default' => '