get_section( 'colors' )->description = __( 'Background may only be visible on wide screens.', 'ridizain' ); $wp_customize->get_section( 'background_image' )->description = __( 'Background may only be visible on wide screens.', 'ridizain' ); // Add postMessage support for site title and description. $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; // Rename the label to "Site Title Color" because this only affects the site title in this theme. $wp_customize->get_control( 'header_textcolor' )->label = __( 'Site Title Color', 'ridizain' ); // Rename the label to "Display Site Title & Tagline" in order to make this option extra clear. $wp_customize->get_control( 'display_header_text' )->label = __( 'Display Site Title & Tagline', 'ridizain' ); // Add the featured content section in case it's not already there. $wp_customize->add_section( 'featured_content', array( 'title' => __( 'Ridizain Featured Content', 'ridizain' ), 'description' => sprintf( __( 'Use a tag to feature your posts. If no posts match the tag, sticky posts will be displayed instead.', 'ridizain' ), admin_url( '/edit.php?tag=featured' ), admin_url( '/edit.php?show_sticky=1' ) ), 'priority' => 31, ) ); $wp_customize->add_section( 'ridizain_general_options' , array( 'title' => __('Ridizain General Options','ridizain'), 'description' => sprintf( __( 'Use the following settings to set sitewide options.', 'ridizain' )), 'priority' => 30, ) ); $wp_customize->add_section( 'ridizain_fitvids_options' , array( 'title' => __('Ridizain FitVids Options','ridizain'), 'description' => sprintf( __( 'Use the following settings to set fitvids script options. Options are: Enable script, Set selector (Default is .post) and set custom selector (optional) for other areas like .sidebar or a custom section!', 'ridizain' )), 'priority' => 32, ) ); // Logo Image Upload $wp_customize->add_setting('ridizain_logo_image', array( 'default-image' => '', )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'ridizain_logo', array( 'label' => __( 'Upload a logo', 'ridizain' ), 'section' => 'title_tagline', 'settings' => 'ridizain_logo_image', ) ) ); // Set Blog feed to full width i.e. hide the content sidebar. $wp_customize->add_setting( 'ridizain_fullwidth_blog_feed' ); $wp_customize->add_control( 'ridizain_fullwidth_blog_feed', array( 'type' => 'checkbox', 'label' => __('Check to hide the sidebar on the blog feed', 'ridizain'), 'section' => 'ridizain_general_options', 'priority' => 1, ) ); $wp_customize->add_setting( 'ridizain_feed_thumb_height', array( 'default' => '572', 'sanitize_callback' => 'ridizain_sanitize_integer' )); $wp_customize->add_control( 'ridizain_feed_thumb_height', array( 'label' => __('Set Overall Content Image max-height (numbers only!) - Full Width Blog Feed Only.','ridizain'), 'section' => 'ridizain_general_options', 'priority' => 2, 'type' => 'text', )); // Set Blog feed to full width i.e. hide the content sidebar. $wp_customize->add_setting( 'ridizain_fullwidth_single_post' ); $wp_customize->add_control( 'ridizain_fullwidth_single_post', array( 'type' => 'checkbox', 'label' => __('Check to show full width single post', 'ridizain'), 'section' => 'ridizain_general_options', 'priority' => 3, ) ); $wp_customize->add_setting( 'ridizain_singular_thumb_visibility' ); $wp_customize->add_control( 'ridizain_singular_thumb_visibility', array( 'type' => 'checkbox', 'label' => __('Check to hide thumbnail on single post', 'ridizain'), 'section' => 'ridizain_general_options', 'priority' => 4, ) ); $wp_customize->add_setting( 'ridizain_singular_thumb_height', array( 'default' => '572', 'sanitize_callback' => 'ridizain_sanitize_integer' )); $wp_customize->add_control( 'ridizain_singular_thumb_height', array( 'label' => __('Set Single Post Featured Image max-height (numbers only!) - Full Width Posts Only.','ridizain'), 'section' => 'ridizain_general_options', 'priority' => 5, 'type' => 'text', )); // Add the featured content layout setting and control. $wp_customize->add_setting( 'featured_content_layout', array( 'default' => 'grid', 'sanitize_callback' => 'ridizain_sanitize_layout', ) ); $wp_customize->add_control( 'featured_content_layout', array( 'label' => __( 'Layout', 'ridizain' ), 'section' => 'featured_content', 'priority' => 1, 'type' => 'select', 'choices' => array( 'grid' => __( 'Grid', 'ridizain' ), 'slider' => __( 'Slider', 'ridizain' ), ), ) ); $wp_customize->add_setting( 'num_posts_grid', array( 'default' => '6', 'sanitize_callback' => 'ridizain_sanitize_integer' ) ); $wp_customize->add_control( 'num_posts_grid', array( 'label' => __( 'Number of posts for grid', 'text-domain'), 'section' => 'featured_content', 'priority' => 2, 'settings' => 'num_posts_grid', ) ); $wp_customize->add_setting( 'num_posts_slider', array( 'default' => '6', 'sanitize_callback' => 'ridizain_sanitize_integer' ) ); $wp_customize->add_control( 'num_posts_slider', array( 'label' => __( 'Number of posts for slider', 'text-domain'), 'section' => 'featured_content', 'priority' => 3, 'settings' => 'num_posts_slider', ) ); $wp_customize->add_setting( 'ridizain_featured_visibility' ); $wp_customize->add_control( 'ridizain_featured_visibility', array( 'type' => 'checkbox', 'label' => __('Show Featured Posts In Blog Feed?', 'ridizain'), 'section' => 'featured_content', 'priority' => 25, ) ); // Begin Slider Options $wp_customize->add_setting( 'ridizain_enable_autoslide' ); $wp_customize->add_control( 'ridizain_enable_autoslide', array( 'type' => 'checkbox', 'label' => __('Check to set Slider to Auto Slide', 'ridizain'), 'section' => 'featured_content', 'priority' => 26, ) ); $wp_customize->add_setting( 'ridizain_slider_transition', array( 'default' => 'slide', ) ); $wp_customize->add_control( 'ridizain_slider_transition', array( 'label' => __( 'Slider Transition', 'ridizain' ), 'section' => 'featured_content', 'priority' => 27, 'type' => 'radio', 'choices' => array( 'slide' => __( 'Slide', 'ridizain' ), 'fade' => __( 'Fade', 'ridizain' ), ), )); $wp_customize->add_setting( 'ridizain_slider_height', array( 'default' => '500', 'sanitize_callback' => 'ridizain_sanitize_integer' )); $wp_customize->add_control( 'ridizain_slider_height', array( 'label' => __('Set Slider max-height (numbers only!) - Default is 500!','ridizain'), 'section' => 'featured_content', 'priority' => 28, 'type' => 'text', )); // Begin Ridizain color settings $wp_customize->add_setting('ridizain_site_header_bgcolor', array( 'default' => 'ffffff', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'ridizain_site_header_bgcolor', array( 'label' => __('Site Header Background Color', 'ridizain'), 'section' => 'colors', 'priority' => 2, 'settings' => 'ridizain_site_header_bgcolor', ))); $wp_customize->add_setting('ridizain_accent_color', array( 'default' => '41a62a', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'ridizain_accent_color', array( 'label' => __('Site Accent Color', 'ridizain'), 'section' => 'colors', 'priority' => 20, 'settings' => 'ridizain_accent_color', ))); $wp_customize->add_setting('ridizain_accent_hover', array( 'default' => '41a62a', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'ridizain_accent_hover', array( 'label' => __('Site Accent Hover Color', 'ridizain'), 'section' => 'colors', 'priority' => 21, 'settings' => 'ridizain_accent_hover', ))); $wp_customize->add_setting('ridizain_links_color', array( 'default' => '000000', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'ridizain_links_color', array( 'label' => __('Menu Links Color', 'ridizain'), 'section' => 'colors', 'priority' => 23, 'settings' => 'ridizain_links_color', ))); $wp_customize->add_setting('ridizain_links_hover', array( 'default' => '41a62a', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'ridizain_links_hover', array( 'label' => __('Menu Links Hover Color', 'ridizain'), 'section' => 'colors', 'priority' => 24, 'settings' => 'ridizain_links_hover', ))); $wp_customize->add_setting('ridizain_links_active_color', array( 'default' => '41a62a', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'ridizain_links_active_color', array( 'label' => __('Menu Links Active Color', 'ridizain'), 'section' => 'colors', 'priority' => 25, 'settings' => 'ridizain_links_active_color', ))); $wp_customize->add_setting('ridizain_menu_toggle_color', array( 'default' => '000000', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'ridizain_menu_toggle_color', array( 'label' => __('Small Menu Toggle Color', 'ridizain'), 'section' => 'colors', 'priority' => 26, 'settings' => 'ridizain_menu_toggle_color', ))); $wp_customize->add_setting('ridizain_featured_content_color', array( 'default' => 'ffffff', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'ridizain_featured_content_color', array( 'label' => __('Featured Content Color', 'ridizain'), 'section' => 'colors', 'priority' => 27, 'settings' => 'ridizain_featured_content_color', ))); $wp_customize->add_setting('ridizain_featured_content_hover', array( 'default' => '000000', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'ridizain_featured_content_hover', array( 'label' => __('Featured Content Hover Color', 'ridizain'), 'section' => 'colors', 'priority' => 28, 'settings' => 'ridizain_featured_content_hover', ))); // Add FitVids to site $wp_customize->add_setting( 'ridizain_fitvids_enable' ); $wp_customize->add_control( 'ridizain_fitvids_enable', array( 'type' => 'checkbox', 'label' => __('Enable FitVids?', 'ridizain'), 'section' => 'ridizain_fitvids_options', 'priority' => 1, ) ); $wp_customize->add_setting( 'ridizain_fitvids_selector', array( 'default' => '.post', 'sanitize_callback' => 'ridizain_sanitize_text_field' )); $wp_customize->add_control( 'ridizain_fitvids_selector', array( 'label' => __('Enter a selector for FitVids - i.e. .post','ridizain'), 'section' => 'ridizain_fitvids_options', 'priority' => 2, 'type' => 'text', )); $wp_customize->add_setting( 'ridizain_fitvids_custom_selector', array( 'default' => '', 'sanitize_callback' => 'ridizain_sanitize_text_field' )); $wp_customize->add_control( 'ridizain_fitvids_custom_selector', array( 'label' => __('Enter a custom selector for FitVids - i.e. .sidebar','ridizain'), 'section' => 'ridizain_fitvids_options', 'priority' => 3, 'type' => 'text', )); } add_action( 'customize_register', 'ridizain_customize_register' ); /** * Sanitize the Featured Content layout value. * * @since Ridizain 1.0 * * @param string $layout Layout type. * @return string Filtered layout type (grid|slider). */ function ridizain_sanitize_layout( $layout ) { if ( ! in_array( $layout, array( 'grid', 'slider' ) ) ) { $layout = 'grid'; } return $layout; } /** * Sanitize the Integer Input values. * * @since Ridizain 1.0.09 * * @param string $input Integer type. */ function ridizain_sanitize_integer( $input ) { return absint( $input ); } /** * Bind JS handlers to make Theme Customizer preview reload changes asynchronously. * * @since Ridizain 1.0 */ function ridizain_customize_preview_js() { wp_enqueue_script( 'ridizain_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20131205', true ); } add_action( 'customize_preview_init', 'ridizain_customize_preview_js' ); /** * Add contextual help to the Themes and Post edit screens. * * @since Ridizain 1.0 * * @return void */ function ridizain_contextual_help() { if ( 'admin_head-edit.php' === current_filter() && 'post' !== $GLOBALS['typenow'] ) { return; } get_current_screen()->add_help_tab( array( 'id' => 'ridizain', 'title' => __( 'Ridizain', 'ridizain' ), 'content' => '
' . sprintf( __( 'Theme name by WP Strap Code is based on Ridizain and works much the same, therefore the information and links below remain valid. If however you find anything broken or not functioning as it should then please report via our on site support system', 'ridizain' ), 'http://www.wpstrapcode.com', 'http://wordpress.org/themes/ridizain', 'http://www.wpstrapcode.com/support' ) .'
' . '