get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; /*------------------------------------------------------------ Align Site Title and Tagline ============================================================*/ $wp_customize->add_setting( 'blogolife_name_align', array( 'default' => 'text-left', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blogolife_name_align', array( 'label' => __( 'Align Site Title and Tagline', 'blogolife' ), 'section' => 'title_tagline', 'settings' => 'blogolife_name_align', 'type' => 'radio', 'choices' => array( 'text-left' => __( 'Left', 'blogolife' ), 'text-center' => __( 'Center', 'blogolife' ), 'text-right' => __( 'Right', 'blogolife' ), ) ) ) ); /*------------------------------------------------------------ Upload a logo ============================================================*/ $wp_customize->add_setting( 'blogolife_logo', array( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'blogolife_logo', array( 'label' => __( 'Logo Upload 150x30px', 'blogolife' ), 'section' => 'title_tagline', 'settings' => 'blogolife_logo' ) ) ); /*------------------------------------------------------------ Show or hide Header Image ============================================================*/ $wp_customize->add_setting( 'blogolife_header_img', array( 'default' => 'on', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blogolife_header_img', array( 'label' => __( 'Header Image', 'blogolife' ), 'section' => 'header_image', 'settings' => 'blogolife_header_img', 'type' => 'radio', 'choices' => array( 'on' => __( 'Show', 'blogolife' ), 'off' => __( 'Hide', 'blogolife' ) ) ) ) ); /*------------------------------------------------------------ Add Theme Settings ============================================================*/ $wp_customize->add_section( 'blogolife_themes_settings' , array( 'title' => __( 'Theme Settings', 'blogolife' ), 'description'=> __( 'General Theme Settings', 'blogolife' ), 'priority' => 30, ) ); /*------------------------------------------------------------ Add Post Option ============================================================*/ $wp_customize->add_section( 'blogolife_themes_settings_post' , array( 'title' => __( 'Post Settings', 'blogolife' ), 'description'=> __( 'Single and archive Post Settings', 'blogolife' ), 'priority' => 30, ) ); /*------------------------------------------------------------ Show/Hide tags on post and page ============================================================*/ $wp_customize->add_setting( 'blogolife_show_hide_post_tags', array( 'default' => 'on', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blogolife_show_hide_post_tags', array( 'label' => __( 'Tags', 'blogolife' ), 'section' => 'blogolife_themes_settings_post', 'settings' => 'blogolife_show_hide_post_tags', 'type' => 'radio', 'choices' => array( 'on' => __( 'Show', 'blogolife' ), 'off' => __( 'Hide', 'blogolife' ) ) ) ) ); /*------------------------------------------------------------ Show/Hide Categories on post and page ============================================================*/ $wp_customize->add_setting( 'blogolife_show_hide_post_categories', array( 'default' => 'on', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blogolife_show_hide_post_categories', array( 'label' => __( 'Categories', 'blogolife' ), 'section' => 'blogolife_themes_settings_post', 'settings' => 'blogolife_show_hide_post_categories', 'type' => 'radio', 'choices' => array( 'on' => __( 'Show', 'blogolife' ), 'off' => __( 'Hide', 'blogolife' ) ) ) ) ); /*------------------------------------------------------------ Show/Hide Author ============================================================*/ $wp_customize->add_setting( 'blogolife_show_hide_post_author', array( 'default' => 'on', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blogolife_show_hide_post_author', array( 'label' => __( 'Author name', 'blogolife' ), 'section' => 'blogolife_themes_settings_post', 'settings' => 'blogolife_show_hide_post_author', 'type' => 'radio', 'choices' => array( 'on' => __( 'Show', 'blogolife' ), 'off' => __( 'Hide', 'blogolife' ) ) ) ) ); /*------------------------------------------------------------ Show/Hide Post Date ============================================================*/ $wp_customize->add_setting( 'blogolife_show_hide_post_date', array( 'default' => 'on', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blogolife_show_hide_post_date', array( 'label' => __( 'Post Date', 'blogolife' ), 'section' => 'blogolife_themes_settings_post', 'settings' => 'blogolife_show_hide_post_date', 'type' => 'radio', 'choices' => array( 'on' => __( 'Show', 'blogolife' ), 'off' => __( 'Hide', 'blogolife' ) ) ) ) ); /*------------------------------------------------------------ Add Page Option ============================================================*/ $wp_customize->add_section( 'blogolife_themes_settings_page' , array( 'title' => __( 'Page Settings', 'blogolife' ), 'description'=> __( 'Single Page Settings', 'blogolife' ), 'priority' => 30, ) ); /*------------------------------------------------------------ Show/Hide Author ============================================================*/ $wp_customize->add_setting( 'blogolife_show_hide_page_author', array( 'default' => 'on', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blogolife_show_hide_page_author', array( 'label' => __( 'Author name', 'blogolife' ), 'section' => 'blogolife_themes_settings_page', 'settings' => 'blogolife_show_hide_page_author', 'type' => 'radio', 'choices' => array( 'on' => __( 'Show', 'blogolife' ), 'off' => __( 'Hide', 'blogolife' ) ) ) ) ); /*------------------------------------------------------------ Show/Hide Page Date ============================================================*/ $wp_customize->add_setting( 'blogolife_show_hide_page_date', array( 'default' => 'on', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blogolife_show_hide_page_date', array( 'label' => __( 'Page Date', 'blogolife' ), 'section' => 'blogolife_themes_settings_page', 'settings' => 'blogolife_show_hide_page_date', 'type' => 'radio', 'choices' => array( 'on' => __( 'Show', 'blogolife' ), 'off' => __( 'Hide', 'blogolife' ) ) ) ) ); } add_action( 'customize_register', 'blogolife_setings_customize_register', 11 );