240,
'width' => 240,
'flex-height' => true,
) );
add_image_size('vw-ecommerce-shop-homepage-thumb',240,145,true);
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'vw-ecommerce-shop' ),
) );
add_theme_support( 'custom-background', array(
'default-color' => 'ffffff'
) );
/*
* This theme styles the visual editor to resemble the theme style,
* specifically font, colors, icons, and column width.
*/
add_editor_style( array( 'css/editor-style.css', vw_ecommerce_shop_font_url() ) );
}
endif;
add_action( 'after_setup_theme', 'vw_ecommerce_shop_setup' );
/* Theme Widgets Setup */
function vw_ecommerce_shop_widgets_init() {
register_sidebar( array(
'name' => __( 'Blog Sidebar', 'vw-ecommerce-shop' ),
'description' => __( 'Appears on blog page sidebar', 'vw-ecommerce-shop' ),
'id' => 'sidebar-1',
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Page Sidebar', 'vw-ecommerce-shop' ),
'description' => __( 'Appears on page sidebar', 'vw-ecommerce-shop' ),
'id' => 'sidebar-2',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Sidebar 3', 'vw-ecommerce-shop' ),
'description' => __( 'Appears on page sidebar', 'vw-ecommerce-shop' ),
'id' => 'sidebar-3',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer Navigation 1', 'vw-ecommerce-shop' ),
'description' => __( 'Appears on footer 1', 'vw-ecommerce-shop' ),
'id' => 'footer-1',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer Navigation 2', 'vw-ecommerce-shop' ),
'description' => __( 'Appears on footer 2', 'vw-ecommerce-shop' ),
'id' => 'footer-2',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer Navigation 3', 'vw-ecommerce-shop' ),
'description' => __( 'Appears on footer 3', 'vw-ecommerce-shop' ),
'id' => 'footer-3',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer Navigation 4', 'vw-ecommerce-shop' ),
'description' => __( 'Appears on footer 4', 'vw-ecommerce-shop' ),
'id' => 'footer-4',
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'vw_ecommerce_shop_widgets_init' );
/* Theme Font URL */
function vw_ecommerce_shop_font_url() {
$font_url = '';
/* Translators: If there are any character that are
* not supported by PT Sans, translate this to off, do not
* translate into your own language.
*/
$ptsans = _x('on', 'PT Sans font:on or off','vw-ecommerce-shop');
/* Translators: If there are any character that are
* not supported by Roboto, translate this to off, do not
* translate into your own language.
*/
$roboto = _x('on', 'Roboto font:on or off','vw-ecommerce-shop');
/* Translators: If there are any character that are
* not supported by Roboto Condensed, translate this to off, do not
* translate into your own language.
*/
$roboto_cond = _x('on', 'Roboto Condensed font:on or off','vw-ecommerce-shop');
/* Translators: If there are any character that are
* not supported by Roboto Condensed, translate this to off, do not
* translate into your own language.
*/
$Montserrat = _x('on', 'Montserrat:300,400,600,700,800,900','vw-ecommerce-shop');
if('off' !== $ptsans || 'off' !== $roboto || 'off' !== $roboto_cond){
$font_family = array();
if('off' !== $ptsans){
$font_family[] = 'PT Sans:300,400,600,700,800,900';
}
if('off' !== $roboto){
$font_family[] = 'Roboto:400,700';
}
if('off' !== $roboto_cond){
$font_family[] = 'Roboto Condensed:400,700';
}
if('off' !== $Montserrat){
$font_family[] = 'Montserrat:300,400,600,700,800,900';
}
$query_args = array(
'family' => urlencode(implode('|',$font_family)),
);
$font_url = add_query_arg($query_args,'//fonts.googleapis.com/css');
}
return $font_url;
}
/* Theme enqueue scripts */
function vw_ecommerce_shop_scripts() {
wp_enqueue_style( 'vw-ecommerce-shop-font', vw_ecommerce_shop_font_url(), array() );
wp_enqueue_style( 'bootstrap-style', get_template_directory_uri().'/css/bootstrap.css' );
wp_enqueue_style( 'style', get_stylesheet_uri() );
wp_enqueue_style( 'effect', get_template_directory_uri().'/css/effect.css' );
wp_enqueue_style( 'font-awesome', get_template_directory_uri().'/css/font-awesome.css' );
wp_enqueue_style( 'vw-ecommerce-shop-customcss', get_template_directory_uri() . '/css/custom.css' );
if ( is_home() || is_front_page() ) {
wp_enqueue_style( 'nivo-style', get_template_directory_uri().'/css/nivo-slider.css' );
wp_enqueue_script( 'nivo-slider', get_template_directory_uri() . '/js/jquery.nivo.slider.js', array('jquery') );
wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/js/bootstrap.js', array('jquery') ,'',true);
wp_enqueue_script( 'custom-front', get_template_directory_uri() . '/js/custom-front.js', array('jquery') ,'',true);
}
wp_enqueue_script( 'vw-ecommerce-shop-customscripts', get_template_directory_uri() . '/js/custom.js', array('jquery') );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
/* Enqueue the Dashicons script */
wp_enqueue_style( 'dashicons' );
}
add_action( 'wp_enqueue_scripts', 'vw_ecommerce_shop_scripts' );
function vw_ecommerce_shop_ie_stylesheet(){
wp_enqueue_style('vw-ecommerce-shop-ie', get_template_directory_uri().'/css/ie.css');
wp_style_add_data( 'vw-ecommerce-shop-ie', 'conditional', 'IE' );
}
add_action('wp_enqueue_scripts','vw_ecommerce_shop_ie_stylesheet');
/*radio button sanitization*/
function vw_ecommerce_shop_sanitize_choices( $input, $setting ) {
global $wp_customize;
$control = $wp_customize->get_control( $setting->id );
if ( array_key_exists( $input, $control->choices ) ) {
return $input;
} else {
return $setting->default;
}
}
/* Implement the Custom Header feature. */
require get_template_directory() . '/inc/custom-header.php';
/* Custom template tags for this theme. */
require get_template_directory() . '/inc/template-tags.php';
/* Customizer additions. */
require get_template_directory() . '/inc/customizer.php';
?>