'#999999', 'label' => __( 'Toolbar Color', 'apppresser-mobile' ), 'sprintf' => '.site-header, .site-footer, header.toolbar { background-color: **color**; }' ); $colors['list_bg'] = array( 'default' => '#FFFFFF', 'label' => __( 'List Background', 'apppresser-mobile' ), 'sprintf' => '.medialist ul, .list ul, .cardlist .post { background-color: **color**; }' ); return $colors; } add_filter( 'apppressermobile_customizer_color_filter', 'apppressermobile_custom_colors' ); /** * apppressermobile_add_customizer_controls function. * * @access public * @param mixed $wp_customize * @return void */ function apppressermobile_add_customizer_controls( $wp_customize ) { /** * Add Section */ $wp_customize->add_section( 'static_mobile_front_page', array( 'title' => __('Front Page', 'apppresser-mobile'), 'priority' => 10, 'description' => '', //'active_callback' => 'is_front_page' ) ); // $wp_customize->add_section( 'post_lists' , array( // 'title' => __('Post Lists','mytheme'), // 'priority' => 200, // ) ); $wp_customize->add_setting( 'list_control', array( 'sanitize_callback' => 'apppressermobile_sanitize_settings' ) ); $wp_customize->add_control( 'homepage_list_control', array( 'type' => 'select', 'label' => __( 'List Style', 'apppresser-mobile' ), 'section' => 'static_mobile_front_page', 'description' => 'Choose a different list style for your app.', 'priority' => 123, 'settings' => 'list_control', 'choices' => array( 'medialist' => 'Thumbnail list', 'list' => 'No thumbnails', 'cardlist' => 'Card List', ), ) ); if( class_exists('AppPresser_Swipers') ) { // Homepage checkbox $wp_customize->add_setting( 'slider_control', array( 'sanitize_callback' => 'apppressermobile_sanitize_settings' ) ); $wp_customize->add_control( 'homepage_slider_control', array( 'type' => 'checkbox', 'label' => __( 'Add slider to homepage?', 'apppresser-mobile' ), 'section' => 'static_mobile_front_page', 'priority' => 124, 'settings' => 'slider_control', ) ); // Category dropdown $categories = get_categories( array( 'orderby' => 'name', 'order' => 'ASC' ) ); $_cats = array('all'=>'All'); foreach ( $categories as $cat ) { $_cats[$cat->slug] = $cat->name; } $wp_customize->add_setting( 'slider_category_control', array( 'sanitize_callback' => 'apppressermobile_sanitize_settings', 'default' => 'all' ) ); $wp_customize->add_control( 'homepage_slider_category_control', array( 'type' => 'select', 'label' => __( 'What category?', 'apppresser-mobile' ), 'section' => 'static_mobile_front_page', 'priority' => 125, 'choices' => $_cats, 'settings' => 'slider_category_control', 'description' => __('Uses slides custom post type by default. To show all posts, select a category below.', 'apppresser-mobile'), ) ); } } add_action( 'apppressermobile_add_customizer_control', 'apppressermobile_add_customizer_controls' ); function apppressermobile_sanitize_settings( $settings ) { return $settings; }