tag in the document head, * WordPress will provide it for us. */ add_theme_support( 'title-tag' ); /** * Add post-formats support. */ add_theme_support( 'post-formats', array( 'video', 'audio', ) ); /* * 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' ); set_post_thumbnail_size( 1568, 9999 ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'gallery', 'caption', 'style', 'script', 'navigation-widgets', ) ); add_theme_support( 'custom-logo', array( 'height' => 100, 'width' => 300, 'flex-width' => true, 'flex-height' => true, 'unlink-homepage-logo' => true, ) ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); // 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_editor_style( array( 'assets/css/editor-style.css', aqwa_fonts_url() ) ); } public function jetpack_support(){ if ( defined( 'JETPACK__VERSION' ) ) { // Add theme support for Responsive Videos. add_theme_support( 'jetpack-responsive-videos' ); // Add theme support for Infinite Scroll. add_theme_support( 'infinite-scroll', array( 'container' => 'content', 'render' => array( $this, 'components_infinite_scroll_render'), 'footer' => 'page', ) ); // Add theme support for Social Menus add_theme_support( 'jetpack-social-menu' ); } } public function components_infinite_scroll_render() { while ( have_posts() ) { the_post(); if ( is_search() ) : get_template_part( 'template-part/content', 'search' ); else : get_template_part( 'template-parts/content', get_post_format() ); endif; } } public function custom_header(){ // Custom header. add_theme_support( 'custom-header', array( 'default-image' => '%s/assets/images/header-image.jpg', 'default-text-color' => '#c70039', 'random-default' => false, 'width' => 2000, 'height' => 550, 'flex-height' => true, 'flex-width' => false, 'wp-head-callback' => array($this, 'header_style'), ) ); register_default_headers( array( 'default-image' => array( 'url' => '%s/assets/images/header-image.jpg', 'thumbnail_url' => '%s/assets/images/header-image.jpg', 'description' => esc_html__( 'Default Header Image', 'aqwa' ), ), ) ); } public function header_style(){ $header_text_color = get_header_textcolor(); ?> '#ffffff', 'default-image' => '', 'default-repeat' => 'repeat', 'default-position-x' => 'left', 'default-position-y' => 'top', 'default-size' => 'auto', 'default-attachment' => '', 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => '', 'admin-preview-callback' => '' ) ); } public function editor_color_palette(){ // 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', 'aqwa' ), 'slug' => 'black', 'color' => $black, ), array( 'name' => esc_html__( 'Dark gray', 'aqwa' ), 'slug' => 'dark-gray', 'color' => $dark_gray, ), array( 'name' => esc_html__( 'Gray', 'aqwa' ), 'slug' => 'gray', 'color' => $gray, ), array( 'name' => esc_html__( 'Green', 'aqwa' ), 'slug' => 'green', 'color' => $green, ), array( 'name' => esc_html__( 'Blue', 'aqwa' ), 'slug' => 'blue', 'color' => $blue, ), array( 'name' => esc_html__( 'Purple', 'aqwa' ), 'slug' => 'purple', 'color' => $purple, ), array( 'name' => esc_html__( 'Red', 'aqwa' ), 'slug' => 'red', 'color' => $red, ), array( 'name' => esc_html__( 'Orange', 'aqwa' ), 'slug' => 'orange', 'color' => $orange, ), array( 'name' => esc_html__( 'Yellow', 'aqwa' ), 'slug' => 'yellow', 'color' => $yellow, ), array( 'name' => esc_html__( 'White', 'aqwa' ), 'slug' => 'white', 'color' => $white, ), ) ); add_theme_support( 'editor-gradient-presets', array( array( 'name' => esc_html__( 'Purple to yellow', 'aqwa' ), 'gradient' => 'linear-gradient(160deg, ' . $purple . ' 0%, ' . $yellow . ' 100%)', 'slug' => 'purple-to-yellow', ), array( 'name' => esc_html__( 'Yellow to purple', 'aqwa' ), 'gradient' => 'linear-gradient(160deg, ' . $yellow . ' 0%, ' . $purple . ' 100%)', 'slug' => 'yellow-to-purple', ), array( 'name' => esc_html__( 'Green to yellow', 'aqwa' ), 'gradient' => 'linear-gradient(160deg, ' . $green . ' 0%, ' . $yellow . ' 100%)', 'slug' => 'green-to-yellow', ), array( 'name' => esc_html__( 'Yellow to green', 'aqwa' ), 'gradient' => 'linear-gradient(160deg, ' . $yellow . ' 0%, ' . $green . ' 100%)', 'slug' => 'yellow-to-green', ), array( 'name' => esc_html__( 'Red to yellow', 'aqwa' ), 'gradient' => 'linear-gradient(160deg, ' . $red . ' 0%, ' . $yellow . ' 100%)', 'slug' => 'red-to-yellow', ), array( 'name' => esc_html__( 'Yellow to red', 'aqwa' ), 'gradient' => 'linear-gradient(160deg, ' . $yellow . ' 0%, ' . $red . ' 100%)', 'slug' => 'yellow-to-red', ), array( 'name' => esc_html__( 'Purple to red', 'aqwa' ), 'gradient' => 'linear-gradient(160deg, ' . $purple . ' 0%, ' . $red . ' 100%)', 'slug' => 'purple-to-red', ), array( 'name' => esc_html__( 'Red to purple', 'aqwa' ), 'gradient' => 'linear-gradient(160deg, ' . $red . ' 0%, ' . $purple . ' 100%)', 'slug' => 'red-to-purple', ), ) ); } public function content_width() { $GLOBALS['content_width'] = apply_filters( 'aqwa_content_width', 1200 ); } public static function nav_menu(){ register_nav_menus( array( 'primary' => esc_html__( 'Primary Menu', 'aqwa' ) ) ); } public static function crop_image(){ add_image_size('aqwa-slider-full', 1115, 715, true); // width, height, crop add_image_size('aqwa-slider-center', 800, 500, true); // width, height, crop add_image_size('aqwa-featured', 1024, 0, false ); // width, height, crop add_image_size('aqwa-medium', 540, 340, true); // width, height, crop add_image_size('aqwa-medium-square', 400, 250, true); // width, height, crop } public static function sidebar_widget(){ //sidebar in post and pages register_sidebar( array( 'name' => esc_html__( 'Sidebar Widget', 'aqwa' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Widgets in this area will be shown on side of the page.', 'aqwa' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); } public static function footer_widget(){ $column = get_theme_mod('aqwa_footer_widget_column', 'col-lg-3'); // footer siderbar register_sidebar( array( 'name' => esc_html__( 'Footer Widget', 'aqwa' ), 'id' => 'footer-1', 'description' => esc_html__( 'Widgets in this area will be shown on footer of the page.', 'aqwa' ), 'before_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } } Aqwa_Theme_Setup::get_instance(); }