get_setting( 'header_textcolor' )->transport = 'refresh'; $wp_customize->get_control('header_textcolor')->description = __('This feature only works when a logo is used and the site title and tagline are being displayed. You can find these options in the site identity section.', "big-bob"); $wp_customize->get_setting( 'header_image' )->transport = 'refresh'; $wp_customize->get_section( 'header_image' )->description = __("The big-bob theme is designed to maximize the size of any header image or header video while minimizing distortion regardless of the screen size or the header media's dimensions. You should feel free to utilize horizontally or vertically or squarely defined images or videos. If you choose both an image and a video, the image will load first then the video will replace it. Header media is only displayed on your homepage.", "big-bob"); $wp_customize->get_setting( 'header_video' )->transport = 'refresh'; $wp_customize->get_setting( 'custom_logo' )->transport = 'refresh'; $wp_customize->get_control( 'display_header_text' )->description = __('The title and tagline will always be displayed in the navbar whenever a logo is not used, and this checkbox does nothing. However if you use a logo, then this checkbox can be used to add a title and tagline to the middle of the screen.', "big-bob"); $wp_customize->get_control( 'background_color' )->description = __('Black or a dark color works best when the theme is in the default setting. White or a light color works best when the theme is in bright mode.', "big-bob"); $wp_customize->get_control('background_color')->priority = '-3'; $wp_customize->get_section('background_image')->description = __("The Background Copy must be tunred OFF if you want to see the background image in its normal format.", "big-bob"); $wp_customize->get_control( 'external_header_video' )->description = __("YouTube adds extra negative space to its videos, and the Big Bob theme was only designed to accomodate mp4 files, so you will probably need to add additional css or js if you wish to use this feature.", "big-bob"); $wp_customize->get_control( 'external_header_video' )->label = __("Use a YouTube URL", "big-bob"); $wp_customize->get_setting('background_image')->transport = 'refresh'; $wp_customize->add_setting('big_bob_big_description_only', array( 'default' => 'Off', 'transport' => 'refresh', 'sanitize_callback' => 'big_bob_checkMediaFit', )); $wp_customize->add_control('big_bob_big_description_only', array( 'label' => __('Big Tagline Only', 'big-bob'), 'section' => 'title_tagline', 'settings' => 'big_bob_big_description_only', 'type' => 'radio', 'choices' => array( 'On' => __('On', 'big-bob'), 'Off' => __('Off', 'big-bob'), ), 'priority' => 50, 'description' => __('This is only active when there is a logo and the Display Site Title and Tagline option is checked. When this is on the title will not be displayed, and the tagline will become big, and it will be set to the left on screens that are wider and taller.', 'big-bob'), )); $wp_customize->selective_refresh->add_partial( 'big_bob_big_description_only', array( 'render_callback' => 'big_bob_turn_on_big_description', ) ); $wp_customize->add_setting('big_bob_bright_mode', array( 'default' => 'Off', 'transport' => 'refresh', 'sanitize_callback' => 'big_bob_checkMediaFit', )); $wp_customize->add_control('big_bob_bright_mode', array( 'label' => 'Bright Mode', 'section' => 'colors', 'settings' => 'big_bob_bright_mode', 'type' => 'radio', 'choices' => array( 'On' => __('On', 'big-bob'), 'Off' => __('Off', 'big-bob'), ), 'priority' => -4, 'description' => __('This will change the different sections of the site into black text on a white background. It is recommended that you update the background color to white or a bright color if you use this mode.', 'big-bob'), )); $wp_customize->selective_refresh->add_partial( 'big_bob_bright_mode', array( 'render_callback' => 'big_bob_add_bright', ) ); $wp_customize->add_setting('big_bob_background_shadow', array( 'default' => 'Off', 'transport' => 'refresh', 'sanitize_callback' => 'big_bob_checkMediaFit', )); $wp_customize->add_control('big_bob_background_shadow', array( 'label' => 'Shadow Halo', 'section' => 'colors', 'settings' => 'big_bob_background_shadow', 'type' => 'radio', 'choices' => array( 'On' => __('On', 'big-bob'), 'Off' => __('Off', 'big-bob'), ), 'priority' => -2, 'description' => __('This creates a shadow effect around the different sections of your site and changes the style of shadow effect behind the hamburger menu site title.', 'big-bob'), )); $wp_customize->selective_refresh->add_partial( 'big_bob_background_shadow', array( 'render_callback' => 'big_bob_add_shadow', ) ); $wp_customize->add_setting('big_bob_link_color', array( 'default' => '#66cdaa', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color_no_hash', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'big_bob_link_color', array( 'label' => __('Link Color', 'big-bob'), 'section' => 'colors', 'settings' => 'big_bob_link_color', 'priority' => -1, 'description' => __('This will change the color of all the links, but while using the customizer, the only link color that you will see change are the links that are visible on the active screen, however all the links will be updated when you publish. You can use the background color control to test the readability of your link color. Bright link colors tend to be the most versatile. If you want to change any other colors, you can use the Additional CSS Section, but this is not recommended because it will likely have a negative impact on readability.', 'big-bob'), ))); $wp_customize->add_section('big_bob_header_media_options', array( 'title' => __('Header Media Options', 'big-bob'), 'priority' => 79, )); $wp_customize->add_setting('big_bob_media_to_background', array( 'default' => 'Off', 'transport' => 'postMessage', 'sanitize_callback' => 'big_bob_checkMediaFit', )); $wp_customize->add_control('big_bob_media_to_background', array( 'label' => __('Set Header Media to Background', 'big-bob'), 'section' => 'big_bob_header_media_options', 'settings' => 'big_bob_media_to_background', 'type' => 'radio', 'choices' => array( 'On' => __('On', 'big-bob'), 'Off' => __('Off', 'big-bob'), ), 'priority' => 0, 'description' => __('Turning this on will cause the header media to stay in place and the text to scroll over the top of the media.', 'big-bob'), )); $wp_customize->selective_refresh->add_partial( 'big_bob_media_to_background', array( 'render_callback' => 'big_bob_media_in_background', ) ); $wp_customize->add_setting('big_bob_video_on_phone', array( 'default' => 'On', 'transport' => 'postMessage', 'sanitize_callback' => 'big_bob_checkMediaFit', )); $wp_customize->add_control('big_bob_video_on_phone', array( 'label' => __('Show Header Video On Mobile', 'big-bob'), 'section' => 'big_bob_header_media_options', 'settings' => 'big_bob_video_on_phone', 'type' => 'radio', 'choices' => array( 'On' => __('On', 'big-bob'), 'Off' => __('Off', 'big-bob'), ), 'priority' => 0, 'description' => __('Turns off the video for mobile devices with small screen sizes (a width of less than 1050 pixels). The item loaded (image or video) is based on the width when the site loads.', 'big-bob'), )); $wp_customize->selective_refresh->add_partial( 'big_bob_video_on_phone', array( 'render_callback' => 'big_bob_video_for_phone', ) ); $wp_customize->add_setting('big_bob_background_copy', array( 'default' => 'On', 'transport' => 'refresh', 'sanitize_callback' => 'big_bob_checkMediaFit', )); $wp_customize->add_control('big_bob_background_copy', array( 'label' => 'Background Copy', 'section' => 'background_image', 'settings' => 'big_bob_background_copy', 'type' => 'radio', 'choices' => array( 'On' => __('On', 'big-bob'), 'Off' => __('Off', 'big-bob'), ), 'priority' => 0, 'description' => __('This sets a copy of your background image that is centered on your screen in a fixed position on your feed pages (like your posts page). This also turns off your main background image.', 'big-bob'), )); $wp_customize->selective_refresh->add_partial( 'big_bob_background_copy', array( 'render_callback' => 'big_bob_remove_main_background', ) ); $wp_customize->add_setting('big_bob_background_copy_all', array( 'default' => 'Off', 'transport' => 'refresh', 'sanitize_callback' => 'big_bob_checkMediaFit', )); $wp_customize->add_control('big_bob_background_copy_all', array( 'label' => 'Background Copy All Pages', 'section' => 'background_image', 'settings' => 'big_bob_background_copy_all', 'type' => 'radio', 'choices' => array( 'On' => __('On', 'big-bob'), 'Off' => __('Off', 'big-bob'), ), 'priority' => 0, 'description' => __('If the first background copy control is off, then this control will place a copy over the main background image on every page. If the background copy control is on, then turning this control on will turn on the background copy for every page and the main background image will be removed.', 'big-bob'), )); $wp_customize->add_setting('big_bob_mobile_friendly_background', array( 'default' => 'Off', 'transport' => 'refresh', 'sanitize_callback' => 'big_bob_checkMediaFit', )); $wp_customize->add_control('big_bob_mobile_friendly_background', array( 'label' => 'Mobile Friendly Background', 'section' => 'background_image', 'settings' => 'big_bob_mobile_friendly_background', 'type' => 'radio', 'choices' => array( 'On' => __('On', 'big-bob'), 'Off' => __('Off', 'big-bob'), ), 'priority' => 0, 'description' => __('The background copy version of the background image is designed so that it has a high degree of compatibility with mobile browsers. Unfortunately, most major mobile browsers have ways of handling fullscreen fixed background images that many users find to be unfavorable. If you turn the mobile friendly (mf) background control on when the background copy (bc) is off and the background copy all (bca) is on then the fullscreen background image will be replaced with the background copy on screens less than 1050 logical pixels. This means the background copy will be displayed on almost all mobile devices, and the fullscreen will be shown on almost all laptops and desktops. If you turn bc and bca off and turn mf on then no background image will be displayed on mobile devices. If bc is on then mf does nothing.', 'big-bob'), )); $wp_customize->selective_refresh->add_partial( 'big_bob_mobile_friendly_background', array( 'render_callback' => 'big_bob_remove_main_background', ) ); $wp_customize->add_section('big_bob_navigation', array( 'title' => 'Navigation', 'priority' => 101, )); $wp_customize->add_setting('big_bob_sticky_sidebar', array( 'default' => 'Off', 'transport' => 'postMessage', 'sanitize_callback' => 'big_bob_checkMediaFit', )); $wp_customize->add_control('big_bob_sticky_sidebar', array( 'label' => __('Sticky Sidebar', 'big-bob'), 'section' => 'big_bob_navigation', 'settings' => 'big_bob_sticky_sidebar', 'type' => 'radio', 'choices' => array( 'On' => __('On', 'big-bob'), 'Off' => __('Off', 'big-bob'), ), 'priority' => 0, 'description' => __('If a sidebar is being used then turning this on will cause the sidebar to shrink in size if it is big and become its own window with its own scrollbar, and it will stick into position when you scroll down the screen. Please note that you should only use this feature if you are sure that the body of your site will be higher than the size of the sidebar, otherwise you may experience technical difficulties on some devices. If all of your bodies are at least 500px in height, then the height should be sufficient. Turning this on will also reduce the wifth of the footer on smaller screens even if a sidebar is\'nt being used.', 'big-bob'), )); $wp_customize->selective_refresh->add_partial( 'big_bob_sticky_sidebar', array( 'render_callback' => 'big_bob_sidebar_is_sticky', ) ); $wp_customize->add_setting('big_bob_sticky_navbar_on_phone', array( 'default' => 'On', 'transport' => 'postMessage', 'sanitize_callback' => 'big_bob_checkMediaFit', )); $wp_customize->add_control('big_bob_sticky_navbar_on_phone', array( 'label' => __('Sticky Navbar On Phone', 'big-bob'), 'section' => 'big_bob_navigation', 'settings' => 'big_bob_sticky_navbar_on_phone', 'type' => 'radio', 'choices' => array( 'On' => __('On', 'big-bob'), 'Off' => __('Off', 'big-bob'), ), 'priority' => 0, 'description' => __('Turning this off will remove most of the navbar when scrolling down phone screens (screens with a width less than 500px). All that will remain is the menu button.', 'big-bob'), )); $wp_customize->selective_refresh->add_partial( 'big_bob_sticky_navbar_on_phone', array( 'render_callback' => 'big_bob_phone_is_sticky', ) ); $wp_customize->add_section('big_bob_body_style', array( 'title' => 'Body and Sidebar Style', 'priority' => 101, )); $wp_customize->add_setting('big_bob_strict_body_style', array( 'default' => 'Off', 'transport' => 'refresh', 'sanitize_callback' => 'big_bob_checkMediaFit', )); $wp_customize->add_control('big_bob_strict_body_style', array( 'label' => __('Strict Style', 'big-bob'), 'section' => 'big_bob_body_style', 'settings' => 'big_bob_strict_body_style', 'type' => 'radio', 'choices' => array( 'On' => __('On', 'big-bob'), 'Off' => __('Off', 'big-bob'), ), 'priority' => 0, 'description' => __("Turning this on will create a more center aligned style within the body and sidebar of the page. Blocks are more compact on large screens and wider on small screens. If you turn this on, then you may find that you don't have to meet as many style requirements when styling your page, however you may find that some of your existing style choices have been overridden. New style updates may be added as they are neeeded.", 'big-bob'), )); $wp_customize->selective_refresh->add_partial( 'big_bob_strict_body_style', array( 'render_callback' => 'big_bob_turn_on_strict_style', ) ); $wp_customize->add_section('big_bob_background_video', array( 'title' => 'Background Video', 'priority' => 90, 'description' => __('You can use this section to set a background video.', 'big-bob'), )); $wp_customize->add_setting('big_bob_background_video_media', array( 'type' => 'theme_mod', 'sanitize_callback' => 'absint' )); $wp_customize->add_control(new WP_Customize_Media_Control($wp_customize, 'big_bob_background_video_media', array( 'section' => 'big_bob_background_video', 'settings' => 'big_bob_background_video_media', 'label' => __('Load a Background Video to Your Feed Pages.', 'big-bob'), 'mime_type' => 'video', 'priority' => 0, 'description' => __('The default setting will add a background video to your feed pages like your posts page or your search results page. If you want to add the background video to every page, then you can you can turn on the Background Video All button down below. If you want to add a different background video to other pages, you can add a header video or a featured video. Please visit bigbobnetwork.com/demo for instructions on creating featured videos.', 'big-bob'), ))); $wp_customize->add_setting('big_bob_background_video_all', array( 'default' => 'Off', 'transport' => 'refresh', 'sanitize_callback' => 'big_bob_checkMediaFit', )); $wp_customize->add_control('big_bob_background_video_all', array( 'label' => __('Background Video All', 'big-bob'), 'section' => 'big_bob_background_video', 'settings' => 'big_bob_background_video_all', 'type' => 'radio', 'choices' => array( 'On' => __('On', 'big-bob'), 'Off' => __('Off', 'big-bob'), ), 'priority' => 1, 'description' => __("Turning this on will set the background video to all of your pages.", 'big-bob'), )); // Add section. $wp_customize->add_section( 'big_bob_footer' , array( 'title' => __('Footer','big-bob'), 'priority' => 102, 'description' => __("Add the requested data (URL, email address, etc.). Otherwise, leave the entry form completely blank.", 'big-bob'), ) ); // Add settings $wp_customize->add_setting( 'big_bob_footer_url_LinkedIn', array( 'default' => __( '', 'big-bob' ), 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_setting( 'big_bob_footer_url_Twitter', array( 'default' => __( '', 'big-bob' ), 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_setting( 'big_bob_footer_url_YouTube', array( 'default' => __( '', 'big-bob' ), 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_setting( 'big_bob_footer_url_GitHub', array( 'default' => __( '', 'big-bob' ), 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_setting( 'big_bob_footer_url_Instagram', array( 'default' => __( '', 'big-bob' ), 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_setting( 'big_bob_footer_url_WordPress', array( 'default' => __( '', 'big-bob' ), 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_setting( 'big_bob_footer_url_Facebook', array( 'default' => __( '', 'big-bob' ), 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_setting( 'big_bob_footer_url_GooglePlus', array( 'default' => __( '', 'big-bob' ), 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_setting( 'big_bob_email_address', array( 'default' => __( '', 'big-bob' ), 'sanitize_callback' => 'sanitize_email', ) ); $wp_customize->add_setting( 'big_bob_address_line_1', array( 'default' => __( '', 'big-bob' ), 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_setting( 'big_bob_address_line_2', array( 'default' => __( '', 'big-bob' ), 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_setting( 'big_bob_address_line_3', array( 'default' => __( '', 'big-bob' ), 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_setting( 'big_bob_google_maps_address', array( 'default' => __( '', 'big-bob' ), 'sanitize_callback' => 'esc_url_raw', ) ); // Add controls $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'big_bob_footer_url_LinkedIn', array( 'label' => __( 'LinkedIn URL', 'big-bob' ), 'section' => 'big_bob_footer', 'settings' => 'big_bob_footer_url_LinkedIn', 'type' => 'text', 'description' => __("If you leave the form blank, then nothing will be shown, but if you add the URL, then it will create a hyperlink using the requisite icon.", 'big-bob'), ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'big_bob_footer_url_Twitter', array( 'label' => __( 'Twitter URL', 'big-bob' ), 'section' => 'big_bob_footer', 'settings' => 'big_bob_footer_url_Twitter', 'type' => 'text', 'description' => __("If you leave the form blank, then nothing will be shown, but if you add the URL, then it will create a hyperlink using the requisite icon.", 'big-bob'), ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'big_bob_footer_url_YouTube', array( 'label' => __( 'YouTube URL', 'big-bob' ), 'section' => 'big_bob_footer', 'settings' => 'big_bob_footer_url_YouTube', 'type' => 'text', 'description' => __("If you leave the form blank, then nothing will be shown, but if you add the URL, then it will create a hyperlink using the requisite icon.", 'big-bob'), ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'big_bob_footer_url_GitHub', array( 'label' => __( 'GitHub URL', 'big-bob' ), 'section' => 'big_bob_footer', 'settings' => 'big_bob_footer_url_GitHub', 'type' => 'text', 'description' => __("If you leave the form blank, then nothing will be shown, but if you add the URL, then it will create a hyperlink using the requisite icon.", 'big-bob'), ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'big_bob_footer_url_Instagram', array( 'label' => __( 'Instagram URL', 'big-bob' ), 'section' => 'big_bob_footer', 'settings' => 'big_bob_footer_url_Instagram', 'type' => 'text', 'description' => __("If you leave the form blank, then nothing will be shown, but if you add the URL, then it will create a hyperlink using the requisite icon.", 'big-bob'), ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'big_bob_footer_url_WordPress', array( 'label' => __( 'WordPress URL', 'big-bob' ), 'section' => 'big_bob_footer', 'settings' => 'big_bob_footer_url_WordPress', 'type' => 'text', 'description' => __("If you leave the form blank, then nothing will be shown, but if you add the URL, then it will create a hyperlink using the requisite icon.", 'big-bob'), ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'big_bob_footer_url_Facebook', array( 'label' => __( 'Facebook URL', 'big-bob' ), 'section' => 'big_bob_footer', 'settings' => 'big_bob_footer_url_Facebook', 'type' => 'text', 'description' => __("If you leave the form blank, then nothing will be shown, but if you add the URL, then it will create a hyperlink using the requisite icon.", 'big-bob'), ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'big_bob_footer_url_GooglePlus', array( 'label' => __( 'Google Plus URL', 'big-bob' ), 'section' => 'big_bob_footer', 'settings' => 'big_bob_footer_url_GooglePlus', 'type' => 'text', 'description' => __("If you leave the form blank, then nothing will be shown, but if you add the URL, then it will create a hyperlink using the requisite icon.", 'big-bob'), ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'big_bob_email_address', array( 'label' => __( 'Email Address', 'big-bob' ), 'section' => 'big_bob_footer', 'settings' => 'big_bob_email_address', 'type' => 'text', 'description' => __("If you leave the form blank, then nothing will be shown, but if you write in an email address, then it will create an email icon opening the user's default email app with the supplied address.", 'big-bob'), ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'big_bob_address_line_1', array( 'label' => __( 'Physical Address Line 1', 'big-bob' ), 'section' => 'big_bob_footer', 'settings' => 'big_bob_address_line_1', 'type' => 'text', 'description' => __("If you leave the form blank, then nothing will be shown, but if you write something, then it will print exactly what you wrote to the footer.", 'big-bob'), ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'big_bob_address_line_2', array( 'label' => __( 'Physical Address Line 2', 'big-bob' ), 'section' => 'big_bob_footer', 'settings' => 'big_bob_address_line_2', 'type' => 'text', 'description' => __("If you leave the form blank, then nothing will be shown, but if you write something, then it will print exactly what you wrote to the footer.", 'big-bob'), ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'big_bob_address_line_3', array( 'label' => __( 'Physical Address Line 3', 'big-bob' ), 'section' => 'big_bob_footer', 'settings' => 'big_bob_address_line_3', 'type' => 'text', 'description' => __("If you leave the form blank, then nothing will be shown, but if you write something, then it will print exactly what you wrote to the footer.", 'big-bob'), ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'big_bob_google_maps_address', array( 'label' => __( 'Map URL', 'big-bob' ), 'section' => 'big_bob_footer', 'settings' => 'big_bob_google_maps_address', 'type' => 'text', 'description' => __("You can use this to add the URL of an address, and a map link icon will be added. For example, you can look up your business on Google Maps then copy and paste the address from the address bar from the page where your business is mapped.", 'big-bob'), ) ) ); function big_bob_checkMediaFit($input) { $valid = array( 'On' => 'On', 'Off' => 'Off', ); if (array_key_exists($input, $valid)) { return $input; } else { return ''; } } } add_action( 'customize_register', 'big_bob_customize_register' ); /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function big_bob_customize_preview_js() { wp_enqueue_script( 'big-bob-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20151215', true ); } add_action( 'customize_preview_init', 'big_bob_customize_preview_js' ); add_action('wp_head', 'big_bob_customizer_css'); function big_bob_customizer_css() { ?>