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( 'custom-line-height' ); add_theme_support( 'align-wide' ); add_theme_support( 'wp-block-styles' ); add_theme_support( 'responsive-embeds' ); add_theme_support( 'editor-styles' ); add_action('init', function() { register_block_style('core/cover', [ 'name' => 'my-cover-100', 'label' => __('Cover height 100px', 'atmospheres'), 'inline_style' => '.is-style-my-cover-100 { min-height: 100px;}', ]); register_block_style('core/cover', [ 'name' => 'my-cover-200', 'label' => __('Cover height 200px', 'atmospheres'), 'inline_style' => '.is-style-my-cover-200 { min-height: 200px;}', ]); register_block_style('core/cover', [ 'name' => 'my-cover-300', 'label' => __('Cover height 300px', 'atmospheres'), 'inline_style' => '.is-style-my-cover-300 { min-height: 300px;}', ]); register_block_style('core/cover', [ 'name' => 'my-cover-400', 'label' => __('Cover height 400px', 'atmospheres'), 'inline_style' => '.is-style-my-cover-400 { min-height: 400px;}', ]); register_block_style('core/cover', [ 'name' => 'my-cover-500', 'label' => __('Cover height 500px', 'atmospheres'), 'inline_style' => '.is-style-my-cover-500 { min-height: 500px;}', ]); register_block_style( 'core/paragraph', array( 'name' => 'prefix-rounded-corners-5', 'label' => __( 'Rounded corners (Requires background color). Border radius 5px', 'atmospheres' ), 'inline_style' => '.is-style-prefix-rounded-corners-5 { border-radius: 5px; }', ) ); register_block_style( 'core/paragraph', array( 'name' => 'prefix-rounded-corners-10', 'label' => __( 'Rounded corners (Requires background color). Border radius 10px', 'atmospheres' ), 'inline_style' => '.is-style-prefix-rounded-corners-10 { border-radius: 10px; }', ) ); }); // This theme uses wp_nav_menu() in one location. add_theme_support( 'nav-menus' ); register_nav_menu('primary', esc_html__( 'Primary', 'atmospheres' ) ); /* * 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( 'atmospheres__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( 'flex-width' => true, 'flex-height' => true, ) ); register_default_headers( array( 'img1' => array( 'url' => get_template_directory_uri() . '/images/header.jpg', 'thumbnail_url' => get_template_directory_uri() . '/images/header.jpg', 'description' => esc_html__( 'Default Image 1', 'atmospheres' ) ) )); } endif; add_action( 'after_setup_theme', 'atmospheres__setup' ); function wpdocs_theme_add_editor_styles() { add_editor_style( 'editor-styles.css' ); } add_action( 'admin_init', 'wpdocs_theme_add_editor_styles' ); /** * Set the content width in pixels, based on the theme's design and stylesheet. */ function atmospheres__content_width() { // This variable is intended to be overruled from themes. $GLOBALS['content_width'] = apply_filters( 'atmospheres__content_width', 640 ); } add_action( 'after_setup_theme', 'atmospheres__content_width', 0 ); /** * Register widget area. */ function atmospheres__widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'atmospheres' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Add widgets here.', 'atmospheres' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Top', 'atmospheres' ), 'id' => 'top', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Bottom', 'atmospheres' ), 'id' => 'bottom', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 1', 'atmospheres' ), 'id' => 'footer-1', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 2', 'atmospheres' ), 'id' => 'footer-2', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 3', 'atmospheres' ), 'id' => 'footer-3', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 4', 'atmospheres' ), 'id' => 'footer-4', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'atmospheres__widgets_init' ); /** * Enqueue scripts and styles. */ function atmospheres__scripts() { wp_enqueue_script( 'jquery'); wp_enqueue_script( 'atmospheres-menu', get_template_directory_uri() . '/js/menu.js', array(), '', true ); wp_enqueue_style( 'custom-style-css', get_stylesheet_uri() ); wp_enqueue_style( 'dashicons' ); wp_enqueue_style( 'atmospheres-animate-css', get_template_directory_uri() . '/css/animate.css' ); wp_enqueue_style( 'atmospheres-form-css', get_template_directory_uri() . '/css/form-styles.css' ); wp_enqueue_script( 'atmospheres-search-top-js', get_template_directory_uri() . '/js/search-top.js', array(), '', false ); wp_enqueue_script( 'atmospheres-select-search-js', get_template_directory_uri() . '/js/select-search.js', array(), '', true ); wp_enqueue_style( 'atmospheres-font-awesome', get_template_directory_uri() . '/css/font-awesome.css', array(), '', false); wp_enqueue_style( 'atmospheres-font-awesome-v4-shims',get_template_directory_uri() . '/css/v4-shims.css', array(),'',false ); wp_enqueue_style( 'atmospheres-font-awesome-v5-font-face', get_template_directory_uri() . '/css/v5-font-face.css', array(),'', false ); wp_enqueue_style( 'atmospheres-font-awesome-v4-font-face', get_template_directory_uri() . '/css/v4-font-face.css', array(), '', false ); wp_enqueue_style( 'atmospheres-font-oswald', get_template_directory_uri() . '/css/oswald.css' ); wp_enqueue_script( 'atmospheres-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '', true ); wp_enqueue_script( 'atmospheres-mobile-menu', get_template_directory_uri() . '/js/mobile-menu.js', array(), '', false ); wp_enqueue_script( 'atmospheres-viewportchecker', get_template_directory_uri() . '/js/viewportchecker.js', array(), '', true ); wp_enqueue_script( 'atmospheres-top', get_template_directory_uri() . '/js/to-top.js', array(), '', true ); wp_enqueue_style( 'atmospheres-back-top-css', get_template_directory_uri() . '/include/back-to-top/style.css' ); wp_enqueue_script( 'atmospheres-search-top-main-js', get_template_directory_uri() . '/include/back-to-top/main.js', array(), '', true ); wp_enqueue_script( 'atmospheres-search-top-util-js', get_template_directory_uri() . '/include/back-to-top/util.js', array(), '', true ); wp_enqueue_script( 'atmospheres-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' ); } wp_localize_script( 'atmospheres-menu', 'menuObject', array( 'menu_position_abs' => esc_html( get_theme_mod( 'menu_position_absolute' ) ) ) ); } add_action( 'wp_enqueue_scripts', 'atmospheres__scripts' ); function atmospheres_admin_scripts() { wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_style( 'style-admin-css', get_template_directory_uri() . '/css/admin.css' ); wp_enqueue_script( 'admin-js', get_template_directory_uri() . '/js/admin.js', array(), '', true ); } add_action( 'admin_enqueue_scripts', 'atmospheres_admin_scripts' ); /** * Includes */ //require_once get_template_directory() . '/include/classes/class-inline-styles.php'; 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/read-more-button.php'; require_once get_template_directory() . '/include/animations.php'; require_once get_template_directory() . '/include/menu-options.php'; require_once get_template_directory() . '/include/post-options.php'; require_once get_template_directory() . '/include/color-scheme.php'; require_once get_template_directory() . '/include/back-to-top/back-to-top-button.php'; require_once get_template_directory() . '/include/footer-options.php'; require_once get_template_directory() . '/include/range/range-class.php'; require_once get_template_directory() . '/include/typography.php'; require_once get_template_directory() . '/include/dark-mode/dark-mode.php'; require_once get_template_directory() . '/include/sidebar-position.php'; require_once get_template_directory() . '/include/colors.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 atmospheres__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', 'atmospheres__body_classes' ); function atmospheres__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', 'atmospheres__sidebar_position' ); /** * Add a pingback url auto-discovery header for single posts, pages, or attachments. */ function atmospheres__pingback_header() { if ( is_singular() && pings_open() ) { printf( '', esc_url( get_bloginfo( 'pingback_url' ) ) ); } } add_action( 'wp_head', 'atmospheres__pingback_header' );