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' ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'menu-1' => esc_html__( 'Primary', 'astrad' ), ) ); /* * 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', 'style', 'script', ) ); // Set up the WordPress core custom background feature. $args = array( 'default-color' => 'ffffff', 'default-image' => '', ); add_theme_support( "custom-background", $args ); $args = array( 'default-image' => '%s/assets/images/header-image-2.jpg', 'default-text-color' => 'fff', 'width' => 1900, /* 16:9 Aspect Ratio */ 'height' => 441, 'flex-width' => true, 'flex-height' => true ); add_theme_support( "custom-header", $args ); register_default_headers( array( 'banner-1' => array( 'url' => '%s/assets/images/header-image.jpg', 'thumbnail_url' => '%s/assets/images/header-image.jpg', 'description' => '', ), 'banner-2' => array( 'url' => '%s/assets/images/header-image-1.jpg', 'thumbnail_url' => '%s/assets/images/header-image-1.jpg', 'description' => '', ), 'banner-3' => array( 'url' => '%s/assets/images/header-image-2.jpg', 'thumbnail_url' => '%s/assets/images/header-image-2.jpg', 'description' => '', ), 'banner-4' => array( 'url' => '%s/assets/images/header-image-3.jpg', 'thumbnail_url' => '%s/assets/images/header-image-3.jpg', 'description' => '', ), 'banner-5' => array( 'url' => '%s/assets/images/header-image-4.jpg', 'thumbnail_url' => '%s/assets/images/header-image-4.jpg', 'description' => '', ), ) ); // Add support for Block Styles. add_theme_support( 'wp-block-styles' ); // Add support for full and wide align images. add_theme_support( 'align-wide' ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); /* Allow shortcodes in widgets. */ add_filter( 'widget_text', 'do_shortcode' ); // Add custom editor font sizes. add_theme_support( 'editor-font-sizes', array( array( 'name' => esc_html__( 'Extra small', 'astrad' ), 'shortName' => esc_html_x( 'XS', 'Font size', 'astrad' ), 'size' => 16, 'slug' => 'extra-small', ), array( 'name' => esc_html__( 'Small', 'astrad' ), 'shortName' => esc_html_x( 'S', 'Font size', 'astrad' ), 'size' => 18, 'slug' => 'small', ), array( 'name' => esc_html__( 'Normal', 'astrad' ), 'shortName' => esc_html_x( 'M', 'Font size', 'astrad' ), 'size' => 20, 'slug' => 'normal', ), array( 'name' => esc_html__( 'Large', 'astrad' ), 'shortName' => esc_html_x( 'L', 'Font size', 'astrad' ), 'size' => 24, 'slug' => 'large', ), array( 'name' => esc_html__( 'Extra large', 'astrad' ), 'shortName' => esc_html_x( 'XL', 'Font size', 'astrad' ), 'size' => 40, 'slug' => 'extra-large', ), array( 'name' => esc_html__( 'Huge', 'astrad' ), 'shortName' => esc_html_x( 'XXL', 'Font size', 'astrad' ), 'size' => 96, 'slug' => 'huge', ), array( 'name' => esc_html__( 'Gigantic', 'astrad' ), 'shortName' => esc_html_x( 'XXXL', 'Font size', 'astrad' ), 'size' => 144, 'slug' => 'gigantic', ), ) ); // Editor color palette. $black = '#000000'; $dark_gray = '#28303D'; $gray = '#39414D'; $green = '#D1E4DD'; $blue = '#D1DFE4'; $purple = '#D1D1E4'; $red = '#E4D1D1'; $orange = '#E4DAD1'; $yellow = '#EEEADD'; $white = '#FFFFFF'; add_theme_support( 'editor-color-palette', array( array( 'name' => esc_html__( 'Black', 'astrad' ), 'slug' => 'black', 'color' => $black, ), array( 'name' => esc_html__( 'Dark gray', 'astrad' ), 'slug' => 'dark-gray', 'color' => $dark_gray, ), array( 'name' => esc_html__( 'Gray', 'astrad' ), 'slug' => 'gray', 'color' => $gray, ), array( 'name' => esc_html__( 'Green', 'astrad' ), 'slug' => 'green', 'color' => $green, ), array( 'name' => esc_html__( 'Blue', 'astrad' ), 'slug' => 'blue', 'color' => $blue, ), array( 'name' => esc_html__( 'Purple', 'astrad' ), 'slug' => 'purple', 'color' => $purple, ), array( 'name' => esc_html__( 'Red', 'astrad' ), 'slug' => 'red', 'color' => $red, ), array( 'name' => esc_html__( 'Orange', 'astrad' ), 'slug' => 'orange', 'color' => $orange, ), array( 'name' => esc_html__( 'Yellow', 'astrad' ), 'slug' => 'yellow', 'color' => $yellow, ), array( 'name' => esc_html__( 'White', 'astrad' ), 'slug' => 'white', 'color' => $white, ), ) ); add_theme_support( 'editor-gradient-presets', array( array( 'name' => esc_html__( 'Purple to yellow', 'astrad' ), 'gradient' => 'linear-gradient(160deg, ' . $purple . ' 0%, ' . $yellow . ' 100%)', 'slug' => 'purple-to-yellow', ), array( 'name' => esc_html__( 'Yellow to purple', 'astrad' ), 'gradient' => 'linear-gradient(160deg, ' . $yellow . ' 0%, ' . $purple . ' 100%)', 'slug' => 'yellow-to-purple', ), array( 'name' => esc_html__( 'Green to yellow', 'astrad' ), 'gradient' => 'linear-gradient(160deg, ' . $green . ' 0%, ' . $yellow . ' 100%)', 'slug' => 'green-to-yellow', ), array( 'name' => esc_html__( 'Yellow to green', 'astrad' ), 'gradient' => 'linear-gradient(160deg, ' . $yellow . ' 0%, ' . $green . ' 100%)', 'slug' => 'yellow-to-green', ), array( 'name' => esc_html__( 'Red to yellow', 'astrad' ), 'gradient' => 'linear-gradient(160deg, ' . $red . ' 0%, ' . $yellow . ' 100%)', 'slug' => 'red-to-yellow', ), array( 'name' => esc_html__( 'Yellow to red', 'astrad' ), 'gradient' => 'linear-gradient(160deg, ' . $yellow . ' 0%, ' . $red . ' 100%)', 'slug' => 'yellow-to-red', ), array( 'name' => esc_html__( 'Purple to red', 'astrad' ), 'gradient' => 'linear-gradient(160deg, ' . $purple . ' 0%, ' . $red . ' 100%)', 'slug' => 'purple-to-red', ), array( 'name' => esc_html__( 'Red to purple', 'astrad' ), 'gradient' => 'linear-gradient(160deg, ' . $red . ' 0%, ' . $purple . ' 100%)', 'slug' => 'red-to-purple', ), ) ); // Add support for responsive embedded content. add_theme_support( 'responsive-embeds' ); // Add support for custom line height controls. add_theme_support( 'custom-line-height' ); // Add support for experimental link color control. add_theme_support( 'experimental-link-color' ); // Add support for experimental cover block spacing. add_theme_support( 'custom-spacing' ); // Add support for custom units. // This was removed in WordPress 5.6 but is still required to properly support WP 5.5. add_theme_support( 'custom-units' ); /** * Add support for core custom logo. * * @link https://codex.wordpress.org/Theme_Logo */ add_theme_support( 'custom-logo', array( 'width' => 220, 'height' => 64, 'flex-width' => true, 'flex-height' => true, ) ); /* * This theme styles the visual editor to resemble the theme style, * specifically font, colors, and column width. */ add_editor_style( array( 'assets/css/editor-style.css', astrad_fonts_url() ) ); // Add support for editor styles. add_theme_support( 'editor-styles' ); /* * For WooCommerce Product images */ add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-slider' ); } endif; add_action( 'after_setup_theme', 'astrad_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 astrad_content_width() { $GLOBALS['content_width'] = apply_filters( 'astrad_content_width', 640 ); } add_action( 'after_setup_theme', 'astrad_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function astrad_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'astrad' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Add widgets here.', 'astrad' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'astrad_widgets_init' ); function astrad_footer_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Footer 1', 'astrad' ), 'id' => 'footer-widgets', 'description' => esc_html__( 'Add widgets here.', 'astrad' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 2', 'astrad' ), 'id' => 'footer-widgets-2', 'description' => esc_html__( 'Add widgets here.', 'astrad' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 3', 'astrad' ), 'id' => 'footer-widgets-3', 'description' => esc_html__( 'Add widgets here.', 'astrad' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 4', 'astrad' ), 'id' => 'footer-widgets-4', 'description' => esc_html__( 'Add widgets here.', 'astrad' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'astrad_footer_widgets_init' ); /** * Register custom fonts. */ function astrad_fonts_url() { $fonts_url = ''; $font_families = array(); /* * Translators: If there are characters in your language that are not * supported by Montserrat, translate this to 'off'. Do not translate * into your own language. */ $RobotoS = _x( 'on', 'Roboto+Slab font: on or off', 'astrad' ); if ( 'off' !== $RobotoS ) { $font_families[] = 'Roboto+Slab:100,200,300,400,500,600,700,800,900'; } $Roboto = _x( 'on', 'Roboto font: on or off', 'astrad' ); if ( 'off' !== $Roboto ) { $font_families[] = 'Roboto:100,300,400,500,700'; } $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), 'subset' => urlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); return esc_url_raw( $fonts_url ); } /** * Enqueue editor styles for Gutenberg * * @since astrad 1.0.0 */ function astrad_block_editor_styles() { // Block styles. wp_enqueue_style( 'astrad-block-editor-style', get_theme_file_uri( '/assets/css/editor-blocks.css' ) ); // Add custom fonts. wp_enqueue_style( 'astrad-fonts', astrad_fonts_url(), array(), null ); } add_action( 'enqueue_block_editor_assets', 'astrad_block_editor_styles' ); /** * Custom helper functions for this theme. */ require get_template_directory() . '/inc/helpers/helpers.php'; /** * Custom template tags for this theme. */ require get_template_directory() . '/inc/template-tags.php'; /** * Functions which enhance the theme by hooking into WordPress. */ require get_template_directory() . '/inc/template-functions.php'; /** * Customizer additions. */ require get_template_directory() . '/inc/customizer/customizer.php'; require get_template_directory() . '/inc/classes/class-bootstrap-nav-walker.php'; /** * Load Jetpack compatibility file. */ if ( defined( 'JETPACK__VERSION' ) ) { require get_template_directory() . '/inc/jetpack.php'; }