File: /var/www/html/shootinschool/wp-content/themes/shootinschool/includes/setup.php
<?php
if ( ! isset( $content_width ) ) $content_width = 1170;
/*
* PARAMS
* layoutName -> af -> american football
* -> bb -> basketball
* -> sccr -> soccer
* fonts -> font-family
* -> font-weight
*
* */
function getThemeSettings() {
$currentThemeName = get_option('splash_layout', 'basketball');
switch ($currentThemeName) {
case 'americanfootball':
$theme = "af";
$bodyClass = "splashAmericanFootball";
$fonts = array(
array('family' => 'Oswald', 'weight' => '300,400,700', 'onOff' => _x('on', 'Oswald font: on or off', 'splash')),
array('family' => 'Roboto', 'weight' => '500,400,300,400italic,700', 'onOff' => _x('on', 'Roboto font: on or off', 'splash')),
);
break;
case 'soccer':
$theme = "sccr";
$bodyClass = "splashSoccer";
$fonts = array(
array('family' => 'Oswald', 'weight' => '100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic', 'onOff' => _x('on', 'Oswald font: on or off', 'splash')),
);
break;
case 'baseball':
$theme = "baseball";
$bodyClass = "splashBaseball";
$fonts = array(
array('family' => 'Fira+Sans+Condensed', 'weight' => '400,400i,500,500i,600,600i,700,700i,800,800i,900,900i', 'onOff' => _x('on', 'Fira Sans Condensed font: on or off', 'splash'))
);
break;
case 'magazine_one':
$theme = "magazine_one";
$bodyClass = "splashMagazineOne";
$fonts = array(
array('family' => 'Fira+Sans', 'weight' => '300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i', 'onOff' => _x('on', 'Fira Sans font: on or off', 'splash')),
array('family' => 'Source+Sans+Pro', 'weight' => '300,300i,400,400i,600,600i,700,700i,900,900i', 'onOff' => _x('on', 'Source Sans Pro font: on or off', 'splash'))
);
break;
default:
$theme = "bb";
$bodyClass = "splashBasketball";
$fonts = array(
array('family' => 'Roboto+Condensed', 'weight' => '300,400,700', 'onOff' => _x( 'on', 'Roboto Condensed font: on or off', 'splash' )),
array('family' => 'Roboto', 'weight' => '500,400,300,400italic,700', 'onOff' => _x( 'on', 'Roboto font: on or off', 'splash' )),
);
break;
}
$bodyClass .= " " . get_theme_mod('header_type', 'header_1');
$config = array(
'layoutName' => $theme,
'bodyClass' => $bodyClass,
'fonts' => $fonts
);
return $config;
}
function getHTag() {
return (!is_layout("bb")) ? 'h2' : 'h3';
}
add_action( 'after_setup_theme', 'splash_local_theme_setup' );
function splash_local_theme_setup(){
add_theme_support( 'post-thumbnails' );
add_theme_support( 'title-tag' );
add_theme_support( 'sportspress' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption'
) );
//bb
add_image_size('stm-1170-650', 1170, 650, true);
add_image_size('stm-570-350', 570, 350, true);
add_image_size('stm-570-250', 570, 250, true);
add_image_size('stm-270-370', 270, 370, true);
add_image_size('stm-540-500', 540, 500, array('center', 'top'));
add_image_size('stm-270-530', 270, 530, true);
add_image_size('stm-200-200', 200, 200, true);
add_image_size('stm-85-105', 85, 105, true);
//af
add_image_size('stm-255-255', 255, 255, array('center', 'top'));
add_image_size('stm-360-240', 360, 240, true);
add_image_size('stm-360-495', 360, 495, true);
add_image_size('stm-445-400', 445, 400, true);
add_image_size('stm-735-240', 735, 240, true);
add_image_size('stm-255-183', 255, 183, true );
add_image_size('stm-350-250', 350, 250, true);
//soccer
add_image_size( 'blog_list', 270, 220, true );
add_image_size( 'gallery_thumbnail', 80, 80, true );
add_image_size( 'gallery_image', 560, 367, true );
add_image_size( 'gallery_image_mini', 143, 116, true );
add_image_size( 'player_photo', 740, 740, true );
add_image_size( 'team_logo', 98, 98, false );
//bsbl
add_image_size( 'player_stat_ava', 550, 580, true );
//magazine
add_image_size( 'post-350-220', 350, 220, true );
add_image_size( 'post-275-142', 275, 142, true );
add_image_size( 'post-160-120', 160, 120, true );
add_image_size( 'post-110-70', 110, 70, true );
if(is_layout("bb")) {
//add_image_size( 'product_main_img', 98, 98, false );
} elseif (is_layout("af")) {
//add_image_size( 'product_main_img', 358, 488, false );
} elseif(is_layout("sccr")) {
//add_image_size( 'product_main_img', 350, 410, false );
}
load_theme_textdomain( 'splash', get_template_directory() . '/languages' );
register_nav_menus( array(
'primary' => esc_html__( 'Header menu', 'splash' ),
'bottom_menu' => esc_html__( 'Bottom Widget menu', 'splash' ),
'sidebar_menu' => esc_html__( 'Sidebar menu', 'splash' ),
) );
register_sidebar( array(
'name' => esc_html__( 'Primary Sidebar', 'splash' ),
'id' => 'default',
'description' => esc_html__( 'Main sidebar that appears on the right or left.', 'splash' ),
'before_widget' => '<aside id="%1$s" class="widget widget-default %2$s">',
'after_widget' => '</aside>',
'before_title' => '<div class="widget-title"><h4>',
'after_title' => '</h4></div>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer', 'splash' ),
'id' => 'footer',
'description' => esc_html__( 'Footer Widgets Area', 'splash' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s"><div class="widget-wrapper">',
'after_widget' => '</div></aside>',
'before_title' => '<div class="widget-title"><h6>',
'after_title' => '</h6></div>',
) );
register_sidebar( array(
'name' => esc_html__( 'SportsPress', 'splash' ),
'id' => 'sportspress',
'description' => esc_html__( 'SportsPress Widgets Area', 'splash' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s"><div class="widget-wrapper">',
'after_widget' => '</div></aside>',
'before_title' => '<div class="widget-title"><h6>',
'after_title' => '</h6></div>',
) );
if ( class_exists( 'WooCommerce' ) ) {
register_sidebar( array(
'name' => esc_html__( 'Shop', 'splash' ),
'id' => 'shop',
'description' => esc_html__( 'Woocommerce pages sidebar', 'splash' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<div class="widget_title"><h3>',
'after_title' => '</h3></div>',
) );
}
add_theme_support('post-formats', array('video', 'audio', 'image'));
}