cats = get_categories($options); parent::__construct( $manager, $id, $args ); } /** * Render the content of the category dropdown * * @return HTML */ public function render_content() { if(!empty($this->cats)) { ?> add_panel( 'slider_panel', array( 'priority' => 126, 'capability' => 'edit_theme_options', 'title' => __('Slider Section', 'business-a' ), ) ); /* Slider Settings */ $wp_customize->add_section( 'slider_setting' , array( 'title' => __('Settings', 'business-a' ), 'panel' => 'slider_panel', 'description'=> 'Show your slider in your front page. First you setup your front page. Click Here!

Create a post ( link ) and assign it a category. and select below slider content setting to choose your slider category.

', ) ); // slider enable $wp_customize->add_setting( 'business_option[slider_enable]' , array( 'default' => true, 'sanitize_callback' => 'business_a_sanitize_checkbox', 'type'=>'option' )); $wp_customize->add_control('business_option[slider_enable]' , array( 'label' => __('Enable Slider','business-a' ), 'section' => 'slider_setting', 'type'=>'checkbox', ) ); // slider animation type $wp_customize->add_setting( 'business_option[slider_animation_type]' , array( 'default' => 'slide', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[slider_animation_type]' , array( 'label' => __('Slider Animation Type','business-a' ), 'section' => 'slider_setting', 'type'=>'select', 'choices'=>array( 'slide'=>'Slide', 'fade'=>'Fade', ), ) ); // slider speed $wp_customize->add_setting( 'business_option[slider_speed]' , array( 'default' => 3000, 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[slider_speed]' , array( 'label' => __('Slider Speed','business-a' ), 'section' => 'slider_setting', 'type'=>'select', 'choices'=>array( 500 => 500, 1000 => 1000, 2000 => 2000, 3000 => 3000, 4000 => 4000, 5000 => 5000, 6000 => 6000, 7000 => 7000, 8000 => 8000, 9000 => 9000, 10000 => 10000, ), ) ); /* Slider Slides */ $wp_customize->add_section( 'slider_slide' , array( 'title' => __('Slider Content', 'business-a' ), 'panel' => 'slider_panel', ) ); // slider cat $wp_customize->add_setting('business_option[slider_cat]',array( 'default' => 1, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'business_a_slider_sanitize', 'type'=>'option', ) ); $wp_customize->add_control( new business_a_category_dropdown_custom_control( $wp_customize, 'business_option[slider_cat]', array( 'label' => __('Select category to show slides','business-a' ), 'section' => 'slider_slide', 'settings' => 'business_option[slider_cat]', ) ) ); /* SERVICE SETTINGS */ $wp_customize->add_panel( 'service_panel', array( 'priority' => 128, 'capability' => 'edit_theme_options', 'title' => __('Service Section', 'business-a' ), ) ); /* Service Settings */ $wp_customize->add_section( 'service_settings' , array( 'title' => __('Service Settings', 'business-a' ), 'panel' => 'service_panel', 'priority' => 1, 'description'=> 'Show your services in your front page. First you setup your front page. Click Here!

Add your service in fornt page.
Go To back and select Home Page Service section and add a service widget and fill it your service information. and add more service by just add a new service widget.

', ) ); // service section enable/disable $wp_customize->add_setting( 'business_option[service_section_enable]' , array( 'default' => true, 'sanitize_callback' => 'business_a_sanitize_checkbox', 'type'=>'option' )); $wp_customize->add_control('business_option[service_section_enable]' , array( 'label' => __('Enable Service Section','business-a' ), 'section' => 'service_settings', 'type'=>'checkbox', ) ); /* Service header */ $wp_customize->add_section( 'service_header' , array( 'title' => __('Section Header', 'business-a' ), 'panel' => 'service_panel', 'priority' => 2, ) ); // service section title $wp_customize->add_setting( 'business_option[service_section_title]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[service_section_title]' , array( 'label' => __('Service Section Title','business-a' ), 'section' => 'service_header', 'type'=>'text', ) ); // service section description $wp_customize->add_setting( 'business_option[service_section_description]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[service_section_description]' , array( 'label' => __('Service Section Description','business-a' ), 'section' => 'service_header', 'type'=>'text', ) ); /* Service background */ $wp_customize->add_section( 'service_background' , array( 'title' => __('Section Background', 'business-a' ), 'panel' => 'service_panel', 'priority' => 3, ) ); // service section background color $wp_customize->add_setting( 'business_option[service_section_backgorund_color]' , array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize , 'business_option[service_section_backgorund_color]' , array( 'label' => __('Section Background Color','business-a' ), 'section' => 'service_background', 'settings'=>'business_option[service_section_backgorund_color]' ) ) ); // service section image $wp_customize->add_setting( 'business_option[service_section_image]' , array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', 'type'=>'option' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize , 'business_option[service_section_image]' , array( 'label' => __( 'Service Section Image', 'business-a' ), 'description'=> __('Upload your background image minimum size ( 1600 x 900 ).','business-a'), 'section' => 'service_background', ) ) ); $wp_customize->add_setting( 'business_option[service_section_image_repeat]', array( 'default' => 'repeat', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' ) ); $wp_customize->add_control( 'business_option[service_section_image_repeat]', array( 'label' => __( 'Background Repeat', 'business-a' ), 'section' => 'service_background', 'settings' => 'business_option[service_section_image_repeat]', 'type' => 'select', 'choices' => array( 'no-repeat' => __('No Repeat','business-a'), 'repeat' => __('Tile','business-a'), 'repeat-x' => __('Tile Horizontally','business-a'), 'repeat-y' => __('Tile Vertically','business-a'), ), ) ); /* NEWS SETTINGS */ $wp_customize->add_panel( 'news_panel', array( 'priority' => 129, 'capability' => 'edit_theme_options', 'title' => __('News Section', 'business-a' ), ) ); /* News Settings */ $wp_customize->add_section( 'news_settings' , array( 'title' => __('Settings', 'business-a' ), 'panel' => 'news_panel', 'description'=> 'Show your latest news in your front page. First you setup your front page. Click Here!

Go To back and select Section Contacts Setting and select news category for fornt page.

', ) ); // news section enable/disable $wp_customize->add_setting( 'business_option[news_section_enable]' , array( 'default' => true, 'sanitize_callback' => 'business_a_sanitize_checkbox', 'type'=>'option' )); $wp_customize->add_control('business_option[news_section_enable]' , array( 'label' => __('Enable News Section','business-a' ), 'section' => 'news_settings', 'type'=>'checkbox', ) ); /* section header */ $wp_customize->add_section( 'news_header' , array( 'title' => __('Section Header', 'business-a' ), 'panel' => 'news_panel' ) ); // news section title $wp_customize->add_setting( 'business_option[news_section_title]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[news_section_title]' , array( 'label' => __('News Section Title','business-a' ), 'section' => 'news_header', 'type'=>'text', ) ); // news section description $wp_customize->add_setting( 'business_option[news_section_description]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[news_section_description]' , array( 'label' => __('News Section Description','business-a' ), 'section' => 'news_header', 'type'=>'text', ) ); /* section content */ $wp_customize->add_section( 'news_content' , array( 'title' => __('Section Contents', 'business-a' ), 'panel' => 'news_panel' ) ); // news no of show $wp_customize->add_setting( 'business_option[news_no_of_show]' , array( 'default' => 4, 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[news_no_of_show]' , array( 'label' => __('News No Of Show','business-a' ), 'section' => 'news_content', 'type'=>'number', ) ); // news category show $wp_customize->add_setting( 'business_option[news_category_show]' , array( 'default' => 1, 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[news_category_show]' , array( 'label' => __('News Category Show','business-a' ), 'section' => 'news_content', 'type'=>'select', 'choices'=> business_a_get_post_category(), ) ); /* section background */ $wp_customize->add_section( 'news_background' , array( 'title' => __('Section Background', 'business-a' ), 'panel' => 'news_panel' ) ); // news section background color $wp_customize->add_setting( 'business_option[news_section_backgorund_color]' , array( 'default' => '#F2FCFE', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize , 'business_option[news_section_backgorund_color]' , array( 'label' => __('Section Background Color','business-a' ), 'section' => 'news_background', 'settings'=>'business_option[news_section_backgorund_color]' ) ) ); // News section image $wp_customize->add_setting( 'business_option[news_section_image]' , array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', 'type'=>'option' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize , 'business_option[news_section_image]' , array( 'label' => __( 'News Section Image', 'business-a' ), 'description'=> __('Upload your background image minimum size ( 1600 x 900 ).','business-a'), 'section' => 'news_background', ) ) ); $wp_customize->add_setting( 'business_option[news_section_image_repeat]', array( 'default' => 'repeat', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' ) ); $wp_customize->add_control( 'business_option[news_section_image_repeat]', array( 'label' => __( 'Background Repeat', 'business-a' ), 'section' => 'news_background', 'settings' => 'business_option[news_section_image_repeat]', 'type' => 'select', 'choices' => array( 'no-repeat' => __('No Repeat','business-a'), 'repeat' => __('Tile','business-a'), 'repeat-x' => __('Tile Horizontally','business-a'), 'repeat-y' => __('Tile Vertically','business-a'), ), ) ); /* CONTACT SETTINGS */ $wp_customize->add_panel( 'contact_panel', array( 'priority' => 134, 'capability' => 'edit_theme_options', 'title' => __('Contact Section', 'business-a' ), ) ); /* Contact Settings */ $wp_customize->add_section( 'contact_settings' , array( 'title' => __('Settings', 'business-a' ), 'panel' => 'contact_panel', 'priority' => 1, 'description'=> 'Show your contact information in your front page. First you setup your front page. Click Here!

Go To back and select Home Page Contact Sidebar and add a Contact Info Widget to show your contact information on your front page.

', ) ); // Contact section enable/disable $wp_customize->add_setting( 'business_option[contact_section_enable]' , array( 'default' => true, 'sanitize_callback' => 'business_a_sanitize_checkbox', 'type'=>'option' )); $wp_customize->add_control('business_option[contact_section_enable]' , array( 'label' => __('Enable Contact Section', 'business-a'), 'section' => 'contact_settings', 'type'=>'checkbox', ) ); // Contact widget column layout $wp_customize->add_setting( 'business_option[contact_section_column]' , array( 'default' => 3, 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[contact_section_column]' , array( 'label' => __('Column Layout', 'business-a'), 'section' => 'contact_settings', 'type'=>'select', 'choices'=>array( 1 => 1, 2 => 2, 3 => 3, 4 => 4, ) ) ); /* Contact header */ $wp_customize->add_section( 'contact_header' , array( 'title' => __('Contact Header', 'business-a'), 'panel' => 'contact_panel', 'priority' => 2, ) ); // Contact section title $wp_customize->add_setting( 'business_option[contact_section_title]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[contact_section_title]' , array( 'label' => __('Contact Section Title', 'business-a'), 'section' => 'contact_header', 'type'=>'text', ) ); // Contact section description $wp_customize->add_setting( 'business_option[contact_section_description]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[contact_section_description]' , array( 'label' => __('Contact Section Description', 'business-a'), 'section' => 'contact_header', 'type'=>'text', ) ); } add_action( 'customize_register', 'business_a_homepage_settings_fucntion' ); function business_a_get_post_category(){ $cats = get_categories(); $arr = array(); foreach($cats as $cat){ $arr[$cat->term_id] = $cat->name; } return $arr; }