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.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
//Default WordPress
the_post_thumbnail( 'thumbnail' ); // Thumbnail (150 x 150 hard cropped)
the_post_thumbnail( 'medium' ); // Medium resolution (300 x 300 max height 300px)
the_post_thumbnail( 'medium_large' ); // Medium Large (added in WP 4.4) resolution (768 x 0 infinite height)
the_post_thumbnail( 'large' ); // Large resolution (1024 x 1024 max height 1024px)
the_post_thumbnail( 'full' ); // Full resolution (original size uploaded)
//With WooCommerce
the_post_thumbnail( 'shop_thumbnail' ); // Shop thumbnail (180 x 180 hard cropped)
the_post_thumbnail( 'shop_catalog' ); // Shop catalog (300 x 300 hard cropped)
the_post_thumbnail( 'shop_single' ); // Shop single (600 x 600 hard cropped)
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__( 'Primary', 'adrian-lite' ),
) );
/*
* 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( 'adrian_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.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
//add_theme_support( 'custom-logo', array(
// 'height' => 250,
// 'width' => 250,
// 'flex-width' => true,
// 'flex-height' => true,
//d) );
}
endif;
add_action( 'after_setup_theme', 'adrian_setup' );
add_theme_support( 'post-formats', array( 'video', 'gallery' ) );
/**
* 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 adrian_content_width() {
$GLOBALS['content_width'] = apply_filters( 'adrian_content_width', 640 );
}
add_action( 'after_setup_theme', 'adrian_content_width', 0 );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function adrian_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'adrian-lite' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', 'adrian-lite' ),
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'WooCommerce Sidebar', 'adrian-lite' ),
'id' => 'woo-sidebar',
'description' => esc_html__( 'Add widgets here.', 'adrian-lite' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 1', 'adrian-lite' ),
'id' => 'footer-1',
'description' => esc_html__( 'Add footer widgets here.', 'adrian-lite' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 2', 'adrian-lite' ),
'id' => 'footer-2',
'description' => esc_html__( 'Add footer widgets here.', 'adrian-lite' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 3', 'adrian-lite' ),
'id' => 'footer-3',
'description' => esc_html__( 'Add footer widgets here.', 'adrian-lite' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 4', 'adrian-lite' ),
'id' => 'footer-4',
'description' => esc_html__( 'Add footer widgets here.', 'adrian-lite' ),
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'adrian_widgets_init' );
/**
* Enqueue scripts and styles.
*/
function adrian_scripts() {
wp_enqueue_style( 'adrian-style', get_stylesheet_uri() );
wp_enqueue_style( 'bootstrap-css', get_template_directory_uri() . '/assets/css/bootstrap.min.css', false, null, 'all');
wp_enqueue_style( 'animate-css', get_template_directory_uri() . '/assets/css/animate.css', false, null, 'all');
wp_enqueue_style( 'fontawesome-css', get_template_directory_uri() . '/assets/css/font-awesome.min.css', false, null, 'all');
wp_enqueue_style( 'owl-css', get_template_directory_uri() . '/assets/css/owl.carousel.css', false, null, 'all');
wp_enqueue_script( 'jquery-min', get_template_directory_uri() . '/assets/js/jquery-min.js',false, null, true);
wp_enqueue_script( 'popper-js', get_template_directory_uri() . '/assets/js/popper.min.js', false, null, true );
wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/assets/js/bootstrap.min.js', false, null, true );
wp_enqueue_script( 'shrink-header', get_template_directory_uri() . '/assets/js/shrink-header.js', false, null, true );
wp_enqueue_script( 'jquery-easing', get_template_directory_uri() . '/assets/js/jquery.easing.min.js', false, null, true );
wp_enqueue_script( 'scroll-top', get_template_directory_uri() . '/assets/js/scroll-top.js', false, null, true );
wp_enqueue_script( 'owl', get_template_directory_uri() . '/assets/js/owl.carousel.min.js', false, null, true );
wp_enqueue_script( 'jquery.waypoints.min', get_template_directory_uri() . '/assets/js/jquery.waypoints.min.js', false, null, true );
wp_enqueue_script( 'custom', get_template_directory_uri() . '/assets/js/custom.js', false, null, true );
wp_enqueue_script( 'adrian-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20151215', true );
wp_enqueue_script( 'adrian-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'adrian_scripts' );
/**
* Registers an editor stylesheet for the theme.
*/
function adrian_theme_add_editor_styles() {
add_editor_style( 'custom-editor-style.css' );
}
add_action( 'admin_init', 'adrian_theme_add_editor_styles' );
/**
* 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';
/**
* Custom breadcrumb for this theme.
*/
require get_template_directory() . '/inc/breadcrumb.php';
/**
* Custom css for this theme.
*/
require get_template_directory() . '/inc/custom-css.php';
/**
* Functions which enhance the theme by hooking into WordPress.
*/
require get_template_directory() . '/inc/template-functions.php';
/**
* Load Jetpack compatibility file.
*/
if ( defined( 'JETPACK__VERSION' ) ) {
require get_template_directory() . '/inc/jetpack.php';
}
/**
* Load WooCommerce compatibility file.
*/
if ( class_exists( 'WooCommerce' ) ) {
require get_template_directory() . '/inc/woocommerce.php';
}
/* TGM Plugin Activation */
require_once ( get_template_directory() . '/inc/tgmpa.php' );
add_filter( 'masterslider_disable_auto_update', '__return_true' );
/* Redux */
//require_once ( get_template_directory() . '/inc/redux/redux-framework.php' );
require_once ( get_template_directory() . '/inc/theme-options.php' );
/**
* Get the bootstrap!
* (Update path to use cmb2 or CMB2, depending on the name of the folder.
* Case-sensitive is important on some systems.)
*/
//require_once __DIR__ . '/inc/cmb2/init.php';