'cccccc',
) );
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 300, 9999 );
add_image_size( 'jolene-full-width', jolene_big_thumbnail_size());//big thumbnail
add_image_size( 'jolene-full-screen', 1309);//large thumbnail
$args = array(
'default-image' => get_stylesheet_directory_uri() . '/img/biker.jpg',
'default-text-color' => 'ffffff',
'width' => 1309,
'height' => 390,
'flex-height' => true,
'flex-width' => false,
'wp-head-callback' => 'jolene_header_style',
'admin-head-callback' => 'jolene_admin_header_style',
'admin-preview-callback' => 'jolene_admin_header_image',
);
add_theme_support( 'custom-header', $args );
/*
* Enable support for Post Formats.
*/
add_theme_support( 'post-formats', array(
'aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery',
) );
add_theme_support( 'html5', array(
'search-form', 'comment-form', 'comment-list', 'caption'
) );
add_theme_support( 'title-tag' );
/*
* Enable support for WooCommerce plugin.
*/
add_theme_support( 'woocommerce' );
}
add_action( 'after_setup_theme', 'jolene_setup' );
/**
* Return the Google font stylesheet URL if available.
*
* @since biker 1.0
*/
function biker_get_font_url() {
$font_url = '';
/* translators: If there are characters in your language that are not supported
* by Open Sans fonts, translate this to 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'biker' ) ) {
$subsets = 'latin,latin-ext';
$family = 'Open+Sans:400italic,400,300';
/* translators: To add an additional Open Sans character subset specific to your language,
* translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language.
*/
$subset = _x( 'no-subset', 'Font: add new subset (greek, cyrillic, vietnamese)', 'biker' );
if ( 'cyrillic' == $subset ) {
$subsets .= ',cyrillic,cyrillic-ext';
}
if ( 'greek' == $subset )
$subsets .= ',greek,greek-ext';
elseif ( 'vietnamese' == $subset )
$subsets .= ',vietnamese';
$query_args = array(
'family' => $family,
'subset' => $subsets,
);
$font_url = add_query_arg( $query_args, "//fonts.googleapis.com/css" );
}
return $font_url;
}
/**
* Enqueue parent and child scripts
*
* @package WordPress
* @subpackage biker
* @since biker 1.0
*/
function biker_enqueue_styles() {
wp_enqueue_style( 'biker-parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'biker-style', get_stylesheet_uri(), array( 'biker-parent-style' ) );
wp_enqueue_script( 'biker-nav', get_stylesheet_directory_uri() . '/js/navigation.js', array( ),'20151402', true );
$font_url = biker_get_font_url();
if ( ! empty( $font_url ) )
wp_enqueue_style( 'biker-fonts', esc_url_raw( $font_url ), array(), null );
}
add_action( 'wp_enqueue_scripts', 'biker_enqueue_styles' );
/**
* Unregister fonts
*
* @since biker 1.0
*/
function biker_dequeue_styles() {
wp_dequeue_style('jolene-fonts');
}
add_action( 'wp_print_styles', 'biker_dequeue_styles' );
/**
* Print Demo Widget into the empty sidebar-6.
*
* @since biker 1.0
*/
function biker_empty_sidebar_6() {
the_widget( 'WP_Widget_Calendar', 'title='.__('Calendar', 'biker'), 'before_widget=
&before_title=');
the_widget( 'WP_Widget_Recent_Posts', 'title='.__('Recent Posts', 'biker').'&sortby=post_modified', 'before_widget=&before_title=');
the_widget( 'WP_Widget_Search', 'title='.__('Search', 'biker'), 'before_widget=&before_title=');
}
add_action('jolene_empty_sidebar_6', 'biker_empty_sidebar_6');
/**
* Print Demo Widget into the empty sidebar-8.
*
* @since biker 1.0
*/
function biker_empty_sidebar_8() {
the_widget( 'WP_Widget_Search', '', 'before_widget=&before_title=');
}
add_action('jolene_empty_sidebar_8', 'biker_empty_sidebar_8');
/**
* biker setup.
*
* Filter for theme defaults.
*
* @since biker 1.0
*/
function biker_option_defaults($defaults){
$defaults['color_scheme'] = 'biker';
$defaults['is_second_menu_on_front_page_only'] = '0';
$defaults['is_has_shop_sidebar'] = '';
$defaults['is_has_mobile_sidebar'] = '';
$defaults['is_text_on_front_page_only'] = '';
$defaults['is_empty_6_on'] = 1;
$defaults['is_empty_8_on'] = 1;
$defaults['opacity'] = 0.3;
$defaults['top'] = 'top';
return $defaults;
}
add_filter('jolene_option_defaults', 'biker_option_defaults');
/**
* biker Color scheme.
*
* Default Colors for the child theme biker.
*
* @since biker 1.0
*/
function biker_def_colors($def_colors) {
$def_colors['widget_back'] = '#123456';
$def_colors['site_name_back'] = '#fff';
$def_colors['link_color'] = '#822f2c';
$def_colors['heading_color'] = '#000';
$def_colors['menu1_color'] = '#3f3f3f';
$def_colors['menu1_link'] = '#fff';
$def_colors['menu1_hover'] = '#eee';
$def_colors['menu1_hover_back'] = '#111';
$def_colors['menu2_color'] = '#ff5e58';
$def_colors['menu2_link'] = '#fff';
$def_colors['menu2_hover'] = '#fff';
$def_colors['menu2_hover_back'] = '#822f2c';
$def_colors['menu3_color'] = '#ff5e58';
$def_colors['menu3_link'] = '#fff';
$def_colors['menu3_hover'] = '#fff';
$def_colors['menu3_hover_back'] = '#822f2c';
$def_colors['sidebar1_color'] = '#ff5e58';
$def_colors['sidebar1_link'] = '#fff';
$def_colors['sidebar1_hover'] = '#ccc';
$def_colors['sidebar1_text'] = '#eee';
$def_colors['sidebar2_color'] = '#ff5e58';
$def_colors['sidebar2_link'] = '#fff';
$def_colors['sidebar2_hover'] = '#ccc';
$def_colors['sidebar2_text'] = '#eee';
//columns
$def_colors['sidebar3_color'] = '#ff5e58';
$def_colors['sidebar3_link'] = '#fff';
$def_colors['sidebar3_hover'] = '#000';
$def_colors['sidebar3_text'] = '#eee';
$def_colors['column_header_color'] = '#eee';
$def_colors['column_header_text'] = '#000';
$def_colors['border_color'] = '#fff';
$def_colors['border_shadow_color'] = '#000';
$def_colors['hover_color'] = '#822f2c';
$def_colors['description_color'] = '#eded50';
return $def_colors;
}
add_filter('jolene_def_colors', 'biker_def_colors');
/**
* Add biker Color scheme to the list of color schemes.
*
* @since biker 1.0
*/
function biker_schemes($jolene_schemes) {
$jolene_schemes['biker'] = __( 'Biker', 'biker' );
return $jolene_schemes;
}
add_filter('jolene_schemes', 'biker_schemes');
/**
* Set biker def background to ''.
*
* @since biker 1.0
*/
function biker_column_background($jolene_schemes) {
return get_stylesheet_directory_uri() . '/img/texture.jpg';
}
add_filter('jolene_column_background', 'biker_column_background');
/**
* Print the Header Image or large post image.
*
* @since Jolene 1.0.1
*/
function biker_header_image() {
$defaults = jolene_get_defaults();
if ( 'large' == get_theme_mod( 'post_thumbnail', $defaults['post_thumbnail'] ) && !(function_exists('is_woocommerce') && is_woocommerce()) && ! is_front_page() && ! is_archive() && ! is_home() && ! is_search() ) {
if( ! is_page() ) : ?>
remove_section('jolene_color_scheme');
$wp_customize->remove_control('shadow_color');
$wp_customize->add_setting( 'opacity', array(
'default' => $defaults['opacity'],
'capability' => 'edit_theme_options',
'sanitize_callback' => 'biker_sanitize_opacity'
) );
$wp_customize->add_control( 'opacity', array(
'label' => __('Opacity for menus and other elements', 'jehanne'),
'section' => 'colors',
'settings' => 'opacity',
'type' => 'select',
'priority' => 1,
'choices' => array ('0.1' => '0.1',
'0.2' => '0.2',
'0.3' => '0.3',
'0.4' => '0.4',
'0.5' => '0.5',
'0.6' => '0.6',
'0.7' => '0.7',
'0.8' => '0.8',
'0.9' => '0.9',
'1' => '1')
) );
//column widget background
$wp_customize->add_setting( 'top', array(
'default' => $defaults['top'],
'capability' => 'edit_theme_options',
'sanitize_callback' => 'biker_sanitize_background_position'
) );
$wp_customize->add_control( 'top', array(
'label' => __( 'Vertical position', 'biker' ),
'section' => 'background_image',
'settings' => 'top',
'type' => 'select',
'priority' => 2,
'choices' => array ('top' => __('Top', 'biker'),
'center' => __('Center', 'biker'),
'bottom' => __('Bottom', 'biker'))
) );
$wp_customize->get_setting( 'menu1_color' )->transport = 'refresh';
$wp_customize->get_setting( 'menu2_color' )->transport = 'refresh';
$wp_customize->get_setting( 'menu3_color' )->transport = 'refresh';
$wp_customize->get_setting( 'sidebar1_color' )->transport = 'refresh';
$wp_customize->get_setting( 'sidebar2_color' )->transport = 'refresh';
}
add_action( 'customize_register', 'biker_customize_register', 21 );
/**
* Sanitize opacity.
*
* @param string $value Value to sanitize.
* @return sanitized value.
* @since biker 1.0
*/
function biker_sanitize_opacity( $value ) {
$possible_values = array ('0.1',
'0.2',
'0.3',
'0.4',
'0.5',
'0.6',
'0.7',
'0.8',
'0.9',
'1');
return ( in_array( $value, $possible_values ) ? $value : '0.3' );
}
/**
* Return string Sanitized backgroind position
*
* @since biker 1.0
*/
function biker_sanitize_background_position( $value ) {
$possible_values = array( 'top', 'center', 'bottom');
return ( in_array( $value, $possible_values ) ? $value : 'top' );
}