tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Declare WooCommerce support
add_theme_support( 'woocommerce' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
//set_post_thumbnail_size( 200, 200 );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__( 'Primary', 'all-store' ),
) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'allstore_custom_background_args', array(
'default-color' => '#ffffff',
'default-image' => '',
) ) );
/*
* Enable support for custom logo.
*/
add_theme_support( 'custom-logo', array(
'width' => '',
'height' => '',
'flex-height' => true,
'flex-width' => true,
) );
// Editor custom stylesheet - for user
add_editor_style('css/editor-style.css');
// Add Image Sizes
add_image_size( 'allstore-200x200', '200', '200' ); // Carousel Products
add_image_size( 'allstore-420x600', '420', '600' );
add_image_size( 'allstore-1140x1140', '1140', '1140' );
add_image_size( 'allstore-360x280-c', '360', '280', array('center', 'center') ); // Team
}
endif;
add_action( 'after_setup_theme', 'allstore_setup' );
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function allstore_content_width() {
$GLOBALS['content_width'] = apply_filters( 'allstore_content_width', 1270 );
}
add_action( 'after_setup_theme', 'allstore_content_width', 0 );
/**
* Register widget area.
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function allstore_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Blog Sidebar', 'all-store' ),
'id' => 'allstore-sb-blog',
'description' => esc_html__( 'Add widgets here.', 'all-store' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Shop Sidebar', 'all-store' ),
'id' => 'allstore-sb-1',
'description' => esc_html__( 'Add widgets here.', 'all-store' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 1', 'all-store' ),
'id' => 'allstore-footer-1',
'description' => esc_html__( 'Add widgets here.', 'all-store' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 2', 'all-store' ),
'id' => 'allstore-footer-2',
'description' => esc_html__( 'Add widgets here.', 'all-store' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 3', 'all-store' ),
'id' => 'allstore-footer-3',
'description' => esc_html__( 'Add widgets here.', 'all-store' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 4', 'all-store' ),
'id' => 'allstore-footer-4',
'description' => esc_html__( 'Add widgets here.', 'all-store' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 5', 'all-store' ),
'id' => 'allstore-footer-5',
'description' => esc_html__( 'Add widgets here.', 'all-store' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'allstore_widgets_init' );
/*
Register Fonts
*/
function allstore_fonts_url() {
$font_url = '';
/*
Translators: If there are characters in your language that are not supported
by chosen font(s), translate this to 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Google font: on or off', 'all-store' ) ) {
$font_url = add_query_arg( 'family', urlencode( 'Montserrat:900|PT+Serif:400,400i,700,700i|Roboto:300,300i,400,400i,500,500i,700,700i,900,900i&subset=cyrillic' ), "//fonts.googleapis.com/css" );
}
return $font_url;
}
/**
* Enqueue scripts and styles.
*/
function allstore_styles_scripts() {
// Enqueue stylesheets
wp_enqueue_style( 'allstore-fonts', allstore_fonts_url(), array() );
wp_enqueue_style( 'font-awesome', get_template_directory_uri(). '/css/font-awesome.min.css' );
wp_enqueue_style( 'bootstrap', get_template_directory_uri(). '/css/bootstrap.min.css' );
wp_enqueue_style( 'ion-range-slider', get_template_directory_uri(). '/css/ion.rangeSlider.css' );
wp_enqueue_style( 'bxslider', get_template_directory_uri(). '/css/jquery.bxslider.css' );
wp_enqueue_style( 'fancybox', get_template_directory_uri(). '/css/jquery.fancybox.css' );
wp_enqueue_style( 'flexslider', get_template_directory_uri(). '/css/flexslider.css' );
wp_enqueue_style( 'swiper', get_template_directory_uri(). '/css/swiper.css' );
wp_enqueue_style( 'allstore-main', get_template_directory_uri(). '/css/style.css' );
wp_enqueue_style( 'allstore-media', get_template_directory_uri(). '/css/media.css' );
wp_enqueue_style( 'allstore-style', get_stylesheet_uri() );
// Enqueue scripts
wp_enqueue_script( 'bxslider', get_template_directory_uri().'/js/bxslider.js', array( 'jquery' ), null, true);
wp_enqueue_script( 'flexslider', get_template_directory_uri().'/js/flexslider.js', array( 'jquery' ), null, true);
wp_enqueue_script( 'fancybox', get_template_directory_uri().'/js/fancybox.js', array( 'jquery' ), null, true);
wp_enqueue_script( 'brazzers-carousel', get_template_directory_uri().'/js/brazzers-carousel.js', array( 'jquery' ), null, true);
wp_enqueue_script( 'theia-sticky-sidebar', get_template_directory_uri().'/js/theia-sticky-sidebar.js', array( 'jquery' ), null, true);
wp_enqueue_script( 'chosen-drop-down', get_template_directory_uri().'/js/chosen.jquery.min.js', array( 'jquery' ), null, true);
wp_enqueue_script( 'allstore-main', get_template_directory_uri().'/js/main.js', array( 'jquery' ), null, true);
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'allstore_styles_scripts' );
/**
* Set up the WordPress core custom header feature.
*/
function allstore_custom_header_setup() {
add_theme_support( 'custom-header', apply_filters( 'allstore_custom_header_args', array(
'default-image' => '',
'width' => 1920,
'height' => 120,
'flex-height' => true,
'header-text' => false,
) ) );
}
add_action( 'after_setup_theme', 'allstore_custom_header_setup' );
/*
* Pingback function
*/
function allstore_pingback_header() {
if ( is_singular() && pings_open() ) {
echo '';
}
}
add_action( 'wp_head', 'allstore_pingback_header' );
// Customizer additions.
require get_parent_theme_file_path( '/inc/customizer.php' );
// Show Customizations
require_once trailingslashit( get_template_directory() ) . '/inc/dynamic.php';
// Theme Functions
require get_parent_theme_file_path( '/inc/theme-functions.php' );
require get_parent_theme_file_path( '/inc/woocommerce.php' );
//Theme Widgets
include('inc/widgets/allstore-categories.php');
// TGM Plugins
require_once( trailingslashit( get_template_directory() ) . 'inc/tgm.php' );