/**
* progression functions and definitions
*
* @package progression
* @since progression 1.0
*/
if ( ! function_exists( 'progression_studios_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which runs
* before the init hook. The init hook is too late for some features, such as indicating
* support post thumbnails.
*
* @since progression 1.0
*/
function progression_studios_setup() {
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'custom-logo' );
add_theme_support( 'responsive-embeds' );
add_image_size('progression-studios-blog-index', 900, 475, true);
add_image_size('progression-studios-post-title', 1400, 600, true);
add_image_size('progression-studios-portfolio-index', 700, 700, false);
/**
* Make theme available for translation
* Translations can be filed in the /languages/ directory
* If you're building a theme based on pro, use a find and replace
* to change 'archies-progression' to the name of your theme in all the template files
*/
load_theme_textdomain( 'archies-progression', get_template_directory() . '/languages' );
/**
* This theme uses wp_nav_menu() in one location.
*/
register_nav_menus( array(
'progression-studios-primary' => esc_html__( 'Primary Main Menu', 'archies-progression' ),
) );
}
endif; // progression_studios_setup
add_action( 'after_setup_theme', 'progression_studios_setup' );
/**
* Set the content width based on the theme's design and stylesheet.
*
* @since pro 1.0
*/
if ( ! isset( $content_width ) )
$content_width = esc_attr( get_theme_mod('progression_studios_site_width', '1100') ); /* pixels */
/**
* Register widgetized area and update sidebar with default widgets
*
* @since pro 1.0
*/
function progression_studios_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'archies-progression' ),
'description' => esc_html__('Default sidebar', 'archies-progression'),
'id' => 'progression-studios-sidebar',
'before_widget' => '
',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Shop Sidebar', 'archies-progression' ),
'description' => esc_html__('Sidebar on shop pages', 'archies-progression'),
'id' => 'progression-studios-sidebar-shop',
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'progression_studios_widgets_init' );
/**
* Enqueue scripts and styles
*/
function progression_studios_scripts() {
wp_enqueue_style( 'archies-progression-style', get_stylesheet_uri());
wp_enqueue_style( 'archies-progression-google-fonts', progression_studios_fonts_url(), array( 'archies-progression-style' ), '1.0.0' );
wp_enqueue_style( 'font-awesome-5', get_template_directory_uri() . '/inc/fonts/font-awesome/css/font-awesome-5.css', array( 'archies-progression-style' ), '1.0.0' );
wp_enqueue_script( 'archies-progression-scripts', get_template_directory_uri() . '/js/scripts.js', array( 'jquery' ), '20120206', true );
if ( get_theme_mod( 'progression_studios_page_transition' ) == 'transition-on-pro' ) {
wp_enqueue_style( 'archies-progression-preloader', get_template_directory_uri() . '/css/preloader.css', array( 'archies-progression-style' ), '1.0.0' );
}
if ( get_theme_mod( 'progression_studios_header_sticky') == 'sticky' ) {
wp_enqueue_script( 'scrolltofixed', get_template_directory_uri() . '/js/scrolltofixed.js', array( 'jquery' ), '20120206', true );
wp_enqueue_script( 'sticky-header', get_template_directory_uri() . '/js/sticky-header.js', array( 'jquery' ), '20120206', true );
}
if ( !get_theme_mod( 'progression_studios_header_template') ) {/* Load when not using Elementor Header Template */
wp_enqueue_style( 'archies-progression-default-header', get_template_directory_uri() . '/css/default-header.css', array( 'archies-progression-style' ), '1.0.0' );
wp_enqueue_script( 'superfish', get_template_directory_uri() . '/js/superfish.js', array( 'jquery' ), '20120206', true );
wp_enqueue_script( 'hoverintent', get_template_directory_uri() . '/js/hoverintent.js', array( 'jquery' ), '20120206', true );
wp_enqueue_script( 'jquery-easing', get_template_directory_uri() . '/js/jquery-easing.js', array( 'jquery' ), '20120206', true );
wp_enqueue_script( 'archies-progression-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20120206', true );
}
if ( is_tax( 'portfolio-category' ) ) {
wp_enqueue_script( 'isotope', get_template_directory_uri() . '/js/isotope.js', array( 'jquery' ), '20120206', true );
wp_enqueue_script( 'archies-progression-infinite-scroll', get_template_directory_uri() . '/js/infinite-scroll.js', array( 'jquery' ), '20120206', true );
}
if (
is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'progression_studios_scripts' );
/**
* Enqueue google fonts
*/
function progression_studios_fonts_url() {
$progression_studios_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', 'archies-progression' ) ) {
$progression_studios_font_url = add_query_arg( 'family', urlencode( 'Barlow Condensed:300,400,500,600,700|Barlow:400,500,700|&subset=latin' ), "//fonts.googleapis.com/css" );
}
return $progression_studios_font_url;
}
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Theme Customizer
*/
require get_template_directory() . '/inc/default-customizer.php';
/**
* Elementor Page Builder Functions
*/
require get_template_directory() . '/inc/elementor-functions.php';
/**
* WooCommerce Functions
*/
require get_template_directory() . '/inc/woocommerce-functions.php';
/**
* Masonry JS
*/
require get_template_directory() . '/inc/js-customizer.php';
/**
* Load Plugin Activation
*/
require get_template_directory() . '/inc/tgm-plugin-activation/plugin-activation.php';
/**
* Demo Importer
*/
require get_template_directory() . '/inc/demo/demo-import.php';