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', 'aroid' ), 'footer' => esc_html__( 'Footer Menu', 'aroid' ), 'social' => esc_html__( 'Social Icons', 'aroid' ), ) ); /* * Aroid default core aroid for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', ) ); /** * 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, ) ); // Add support for Yoast SEO Breadcrumbs. add_theme_support( 'yoast-seo-breadcrumbs' ); /* * Add support custom font sizes. * * Add the line below to disable the custom color picker in the editor. * add_theme_support( 'disable-custom-font-sizes' ); */ add_theme_support( 'editor-font-sizes', array( array( 'name' => __( 'Small', 'aroid' ), 'shortName' => __( 'S', 'aroid' ), 'size' => 16, 'slug' => 'small', ), array( 'name' => __( 'Medium', 'aroid' ), 'shortName' => __( 'M', 'aroid' ), 'size' => 20, 'slug' => 'medium', ), array( 'name' => __( 'Large', 'aroid' ), 'shortName' => __( 'L', 'aroid' ), 'size' => 25, 'slug' => 'large', ), array( 'name' => __( 'Larger', 'aroid' ), 'shortName' => __( 'XL', 'aroid' ), 'size' => 35, 'slug' => 'larger', ), ) ); // 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 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 custom editor font sizes. //Credit: Twenty Twenty One theme // 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', 'aroid' ), 'slug' => 'black', 'color' => $black, ), array( 'name' => esc_html__( 'Dark gray', 'aroid' ), 'slug' => 'dark-gray', 'color' => $dark_gray, ), array( 'name' => esc_html__( 'Gray', 'aroid' ), 'slug' => 'gray', 'color' => $gray, ), array( 'name' => esc_html__( 'Green', 'aroid' ), 'slug' => 'green', 'color' => $green, ), array( 'name' => esc_html__( 'Blue', 'aroid' ), 'slug' => 'blue', 'color' => $blue, ), array( 'name' => esc_html__( 'Purple', 'aroid' ), 'slug' => 'purple', 'color' => $purple, ), array( 'name' => esc_html__( 'Red', 'aroid' ), 'slug' => 'red', 'color' => $red, ), array( 'name' => esc_html__( 'Orange', 'aroid' ), 'slug' => 'orange', 'color' => $orange, ), array( 'name' => esc_html__( 'Yellow', 'aroid' ), 'slug' => 'yellow', 'color' => $yellow, ), array( 'name' => esc_html__( 'White', 'aroid' ), 'slug' => 'white', 'color' => $white, ), ) ); add_theme_support( 'editor-gradient-presets', array( array( 'name' => esc_html__( 'Purple to yellow', 'aroid' ), 'gradient' => 'linear-gradient(160deg, ' . $purple . ' 0%, ' . $yellow . ' 100%)', 'slug' => 'purple-to-yellow', ), array( 'name' => esc_html__( 'Yellow to purple', 'aroid' ), 'gradient' => 'linear-gradient(160deg, ' . $yellow . ' 0%, ' . $purple . ' 100%)', 'slug' => 'yellow-to-purple', ), array( 'name' => esc_html__( 'Green to yellow', 'aroid' ), 'gradient' => 'linear-gradient(160deg, ' . $green . ' 0%, ' . $yellow . ' 100%)', 'slug' => 'green-to-yellow', ), array( 'name' => esc_html__( 'Yellow to green', 'aroid' ), 'gradient' => 'linear-gradient(160deg, ' . $yellow . ' 0%, ' . $green . ' 100%)', 'slug' => 'yellow-to-green', ), array( 'name' => esc_html__( 'Red to yellow', 'aroid' ), 'gradient' => 'linear-gradient(160deg, ' . $red . ' 0%, ' . $yellow . ' 100%)', 'slug' => 'red-to-yellow', ), array( 'name' => esc_html__( 'Yellow to red', 'aroid' ), 'gradient' => 'linear-gradient(160deg, ' . $yellow . ' 0%, ' . $red . ' 100%)', 'slug' => 'yellow-to-red', ), array( 'name' => esc_html__( 'Purple to red', 'aroid' ), 'gradient' => 'linear-gradient(160deg, ' . $purple . ' 0%, ' . $red . ' 100%)', 'slug' => 'purple-to-red', ), array( 'name' => esc_html__( 'Red to purple', 'aroid' ), 'gradient' => 'linear-gradient(160deg, ' . $red . ' 0%, ' . $purple . ' 100%)', 'slug' => 'red-to-purple', ), ) ); /** * Add theme support for New Image * * @link https://developer.wordpress.org/reference/functions/add_image_size/ */ add_image_size('aroid-thumbnail-size', 800, 800, true); add_image_size('aroid-related-size', 600, 400, true); add_image_size('aroid-promo-post', 800, 500, true); add_image_size('aroid-related-post-thumbnails', 850, 550, true ); } endif; add_action( 'after_setup_theme', 'aroid_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 aroid_content_width() { // This variable is intended to be overruled from themes. // Open WPCS issue: {@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1043}. // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound $GLOBALS['content_width'] = apply_filters( 'aroid_content_width', 640 ); } add_action( 'after_setup_theme', 'aroid_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function aroid_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'aroid' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Add widgets here.', 'aroid' ), 'before_widget' => '', 'before_title' => '