tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for Post Thumbnails on posts and pages.
*/
add_theme_support( 'post-thumbnails' );
/*
* WooCommerce Support
*/
add_theme_support( 'woocommerce' );
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
/*
* Gutenberg Support
*/
add_theme_support( 'align-wide' );
add_theme_support( 'disable-custom-font-sizes');
add_theme_support( 'disable-custom-colors' );
add_theme_support( 'wp-block-styles' );
add_theme_support( 'responsive-embeds' );
// This theme uses wp_nav_menu() in one location.
add_theme_support( 'nav-menus' );
register_nav_menu('primary', esc_html__( 'Primary', 'askiw' ) );
/*
* 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( 'askiw__custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
/**
* Add support for core custom logo.
*/
add_theme_support( 'custom-logo', array(
'height' => 70,
'width' => 140,
'flex-width' => true,
'flex-height' => false,
) );
register_default_headers( array(
'img1' => array(
'url' => get_template_directory_uri() . '/images/header.webp',
'thumbnail_url' => get_template_directory_uri() . '/images/header.webp',
'description' => esc_html__( 'Default Image 1', 'askiw' )
)
));
}
endif;
add_action( 'after_setup_theme', 'askiw__setup' );
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*/
function askiw__content_width() {
// This variable is intended to be overruled from themes.
$GLOBALS['content_width'] = apply_filters( 'askiw__content_width', 640 );
}
add_action( 'after_setup_theme', 'askiw__content_width', 0 );
/**
* Register widget area.
*/
function askiw__widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'askiw' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', 'askiw' ),
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 1', 'askiw' ),
'id' => 'footer-1',
'description' => '',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 2', 'askiw' ),
'id' => 'footer-2',
'description' => '',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 3', 'askiw' ),
'id' => 'footer-3',
'description' => '',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 4', 'askiw' ),
'id' => 'footer-4',
'description' => '',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'askiw__widgets_init' );
/**
* Enqueue scripts and styles.
*/
function askiw__scripts() {
wp_enqueue_script( 'jquery');
wp_enqueue_script( 'jquery-ui-accordion' );
wp_enqueue_script( 'jquery-ui-core' );
wp_enqueue_script( 'jquery-ui-tabs' );
wp_enqueue_style( 'custom-style-css', get_stylesheet_uri() );
wp_enqueue_style( 'dashicons' );
wp_enqueue_style( 'style-animate-css', get_template_directory_uri() . '/css/animate.css' );
wp_enqueue_script( 'style-search-top-js', get_template_directory_uri() . '/js/search-top.js', array(), '', false );
wp_enqueue_style( 'style-font-awesome', get_template_directory_uri() . '/css/font-awesome.css', array(), '4.7.0' );
wp_enqueue_style( 'style-font-woo-css', get_template_directory_uri() . '/include/woocommerce/woo-css.css', array(), '4.7.0' );
wp_enqueue_script( 'style-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '', true );
wp_enqueue_script( 'style-mobile-menu', get_template_directory_uri() . '/js/mobile-menu.js', array(), '', false );
wp_enqueue_script( 'style-viewportchecker', get_template_directory_uri() . '/js/viewportchecker.js', array(), '', true );
wp_enqueue_script( 'style-top', get_template_directory_uri() . '/js/to-top.js', array(), '', true );
wp_enqueue_script( 'style-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'askiw__scripts' );
/**
* Includes
*/
require_once get_template_directory() . '/include/content-customizer.php';
require_once get_template_directory() . '/include/custom-header.php';
require_once get_template_directory() . '/include/template-tags.php';
require_once get_template_directory() . '/include/customizer.php';
require_once get_template_directory() . '/include/header-top.php';
require_once get_template_directory() . '/include/back-to-top-button.php';
require_once get_template_directory() . '/include/read-more-button.php';
require_once get_template_directory() . '/include/animations/animations.php';
require_once get_template_directory() . '/include/menu-options.php';
require_once get_template_directory() . '/include/header-buttons.php';
require_once get_template_directory() . '/include/post-options.php';
require_once get_template_directory() . '/include/breadcrumbs.php';
require_once get_template_directory() . '/include/color-scheme.php';
/**
* Load Jetpack compatibility file.
*/
if ( defined( 'JETPACK__VERSION' ) ) {
require_once get_template_directory() . '/include/jetpack.php';
}
/**
* Adds custom classes to the array of body classes.
*/
function askiw__body_classes( $classes ) {
// Adds a class of hfeed to non-singular pages.
if ( ! is_singular() ) {
$classes[] = 'hfeed';
}
// Adds a class of no-sidebar when there is no sidebar present.
if ( ! is_active_sidebar( 'sidebar-1' ) ) {
$classes[] = 'no-sidebar';
}
return $classes;
}
add_filter( 'body_class', 'askiw__body_classes' );
function askiw__sidebar_position() {
if ( ( is_active_sidebar('sidebar-1') ) ) {
wp_enqueue_style( 'style-sidebar', get_template_directory_uri() . '/layouts/left-sidebar.css' );
}
}
add_action( 'wp_enqueue_scripts', 'askiw__sidebar_position' );
/**
* Add a pingback url auto-discovery header for single posts, pages, or attachments.
*/
function askiw__pingback_header() {
if ( is_singular() && pings_open() ) {
printf( '', esc_url( get_bloginfo( 'pingback_url' ) ) );
}
}
add_action( 'wp_head', 'askiw__pingback_header' );
/**
* Header Image - Zoom Animation Speed
*/
function askiw__heade_image_zoom_speed () { ?>
-webkit-animation: header-image
s ease-out both;
animation: header-image
s ease-out 0s 1 normal both running;
';
}
add_action( 'askiw__header_search_top', 'askiw__search_top' );
/*********************************************************************************************************
* Customizer Styles
**********************************************************************************************************/
function askiw__customize_checkbox_styles( $input ) { ?>