'eeeeee',
'default-image' => '',
)
);
/* Add a custom header to overwrite the defaults. */
add_theme_support(
'custom-header',
array(
'default-text-color' => 'ffffff',
'default-image' => '%2$s/images/headers/blue.jpg',
'random-default' => false,
'wp-head-callback' => 'material_gaze_custom_header_wp_head',
)
);
/* Register default headers. */
register_default_headers(
array(
'blue' => array(
'url' => '%2$s/images/headers/blue.jpg',
'thumbnail_url' => '%2$s/images/headers/blue-thumb.jpg',
'description' => __( 'default', 'material-gaze' )
),
'red' => array(
'url' => '%2$s/images/headers/red.jpg',
'thumbnail_url' => '%2$s/images/headers/red-thumb.jpg',
'description' => __( 'red', 'material-gaze' )
),
)
);
/* Custom editor stylesheet. */
add_editor_style( '//fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,500,700|Roboto+Condensed:400,300,700' );
/* Filter to add custom default backgrounds (supported by the framework). */
add_filter( 'hybrid_default_backgrounds', 'material_gaze_default_backgrounds' );
/* Add a custom default color for the "primary" color option. */
add_filter( 'theme_mod_color_primary', 'material_gaze_color_primary' );
/* Load stylesheets. */
add_action( 'wp_enqueue_scripts', 'material_gaze_enqueue_styles', 0 );
}
/**
* Add a default custom color for the theme's "primary" color option.
*
* @since 1.0.0
* @access public
* @param string $hex
* @return string
*/
function material_gaze_color_primary( $hex ) {
return $hex ? $hex : '2196F3';
}
function material_gaze_enqueue_styles() {
wp_enqueue_style( 'material-gaze-fonts', '//fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,500,700|Roboto+Condensed:400,300,700' );
}
add_action( 'wp_head', 'material_gaze_wp_head' );
function material_gaze_wp_head() {
$style = '';
$hex = get_theme_mod( 'color_primary', '' );
$style .= "#menu-primary .search-form .search-toggle, .display-header-text #header { background: #{$hex}; } ";
$style .= "input[type='date']:focus, input[type='datetime']:focus, input[type='datetime-local']:focus, input[type='email']:focus, input[type='month']:focus, input[type='number']:focus, input[type='password']:focus, input[type='search']:focus, input[type='tel']:focus, input[type='text']:focus, input[type='time']:focus, input[type='url']:focus, input[type='week']:focus,
textarea:focus, select:focus { border-bottom-color: #{$hex}; box-shadow: 0 1px 0 0 #{$hex}; } ";
echo "\n" . '' . "\n";
}
function material_gaze_custom_header_wp_head() {
if ( !display_header_text() )
return;
$hex = get_header_textcolor();
if ( empty( $hex ) )
return;
$style = "body.custom-header #branding, #site-title { color: #{$hex}; }";
echo "\n" . '' . "\n";
}
/**
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
*/
function material_gaze_customize_preview_js() {
wp_enqueue_script( 'material_gaze_customizer', trailingslashit( CHILD_THEME_URI ) . 'js/customizer.js', array( 'customize-preview' ), '20130508', true );
}
add_action( 'customize_preview_init', 'material_gaze_customize_preview_js' );