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 = __('The background color will only be displayed if there is no background image.
This is also a good tool to use to test the readability of your link color in front of a variety of colors. Dark background colors tend
to be the most versatile.', "big-bob");
$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_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->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 background copy control is off, then this control does nothing. If the background copy control is on,
then turning this control on will turn on the background copy for every page.', 'big-bob'),
));
$wp_customize->selective_refresh->add_partial( 'big_bob_video_on_phone', array(
'render_callback' => 'big_bob_video_for_phone',
) );
$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.', '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',
) );
}
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()
{
?>
'On',
'Off' => 'Off',
);
if (array_key_exists($input, $valid)) {
return $input;
} else {
return '';
}
}