400, 'width' => 400, 'flex-width' => true, 'flex-height' => true, ) ); // Enable support for Post Thumbnail add_theme_support( 'post-thumbnails' ); add_image_size( 'brilliant-large', 780, 520, true ); add_image_size( 'brilliant-fullwidth', 1200, 520, true ); // Set the default content width. $GLOBALS['content_width'] = 1160; // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'main_menu' => esc_html__( 'Main Menu', 'brilliant' ), ) ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); // Add support for responsive embeds. add_theme_support( 'responsive-embeds' ); // Add AMP support add_theme_support( 'amp' ); /* * 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' ) ); // Enable support for Post Formats add_theme_support('post-formats', array( 'image', 'video', 'audio', 'gallery', 'quote' ) ); // Set up the WordPress Custom Background Feature. $defaults = array( 'default-color' => 'f4f4f4', 'default-image' => '', ); add_theme_support( 'custom-background', $defaults ); // This theme styles the visual editor to resemble the theme style, add_editor_style( array( 'inc/css/editor-style.css', brilliant_fonts_url() ) ); // Load regular editor styles into the new block-based editor. add_theme_support( 'editor-styles' ); // Add custom editor font sizes. add_theme_support( 'editor-font-sizes', array( array( 'name' => __( 'Small', 'brilliant' ), 'size' => 14, 'slug' => 'small', ), array( 'name' => __( 'Normal', 'brilliant' ), 'size' => 16, 'slug' => 'normal', ), array( 'name' => __( 'Large', 'brilliant' ), 'size' => 28, 'slug' => 'large', ), array( 'name' => __( 'Huge', 'brilliant' ), 'size' => 32, 'slug' => 'huge', ), ) ); // Add support for custom color scheme. add_theme_support( 'editor-color-palette', array( array( 'name' => __( 'Black', 'brilliant' ), 'slug' => 'black', 'color' => '#000000', ), array( 'name' => __( 'Medium Gray', 'brilliant' ), 'slug' => 'medium-gray', 'color' => '#444444', ), array( 'name' => __( 'Light Gray', 'brilliant' ), 'slug' => 'light-gray', 'color' => '#999999', ), array( 'name' => __( 'White', 'brilliant' ), 'slug' => 'white', 'color' => '#ffffff', ), array( 'name' => __( 'Accent Color', 'brilliant' ), 'slug' => 'accent', 'color' => esc_attr( get_theme_mod( 'accent_color', '#e63855' ) ), ), ) ); } endif; add_action( 'after_setup_theme', 'brilliant_setup' ); if ( ! function_exists( 'brilliant_fonts_url' ) ) : /** * Register Google fonts. * * @return string Google fonts URL for the theme. */ function brilliant_fonts_url() { $fonts_url = ''; $fonts = array(); $subsets = 'latin,latin-ext'; /* translators: If there are characters in your language that are not supported by Raleway, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Raleway: on or off', 'brilliant' ) ) { $fonts[] = 'Raleway:400,700,400italic,700italic'; } /* translators: If there are characters in your language that are not supported by Playfair Display, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Playfair Display: on or off', 'brilliant' ) ) { $fonts[] = 'Playfair Display:400,700'; } /* translators: If there are characters in your language that are not supported by Crimson Text, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Crimson Text: on or off', 'brilliant' ) ) { $fonts[] = 'Crimson Text:400,400italic'; } /* translators: To add an additional character subset specific to your language, translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language. */ $subset = _x( 'no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'brilliant' ); if ( 'cyrillic' == $subset ) { $subsets .= ',cyrillic,cyrillic-ext'; } elseif ( 'greek' == $subset ) { $subsets .= ',greek,greek-ext'; } elseif ( 'devanagari' == $subset ) { $subsets .= ',devanagari'; } elseif ( 'vietnamese' == $subset ) { $subsets .= ',vietnamese'; } if ( $fonts ) { $fonts_url = add_query_arg( array( 'family' => urlencode( implode( '|', $fonts ) ), 'subset' => urlencode( $subsets ), 'display' => 'fallback', ), 'https://fonts.googleapis.com/css' ); } return $fonts_url; } endif; /** * Add preconnect for Google Fonts. * * @since Brilliant 1.2.0 * * @param array $urls URLs to print for resource hints. * @param string $relation_type The relation type the URLs are printed. * @return array URLs to print for resource hints. */ function brilliant_resource_hints( $urls, $relation_type ) { if ( wp_style_is( 'brilliant-fonts', 'queue' ) && 'preconnect' === $relation_type ) { $urls[] = array( 'href' => 'https://fonts.gstatic.com', 'crossorigin', ); } return $urls; } add_filter( 'wp_resource_hints', 'brilliant_resource_hints', 10, 2 ); /** * Enqueue scripts and styles. */ function brilliant_scripts() { // Add Google fonts, used in the main stylesheet. wp_enqueue_style( 'brilliant-fonts', brilliant_fonts_url(), array(), null ); // Add Icons font, used in the main stylesheet. wp_enqueue_style( 'brilliant-icons', get_template_directory_uri() . '/assets/css/elegant-icons.min.css', array(), '1.0.1' ); // Theme stylesheet. $theme_version = wp_get_theme()->get( 'Version' ); wp_enqueue_style( 'brilliant-style', get_stylesheet_uri(), array(), $theme_version ); if( ! brilliant_is_amp() ) { // Main js. wp_enqueue_script( 'brilliant-script', get_template_directory_uri() . '/assets/js/script.js', array(), '20210930', true ); // Comment reply script. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } } add_action( 'wp_enqueue_scripts', 'brilliant_scripts' ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function brilliant_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar', 'brilliant' ), 'id' => 'sidebar-1', 'description' => __( 'Add widgets here to appear in your Sidebar.', 'brilliant' ), 'before_widget' => '', 'before_title' => '
To fully take advantage of the best our theme can offer please visit our Welcome Page.
' . sprintf( __( 'Get started with %s', 'brilliant' ), $my_theme_name ) . '
', // Tabs 'tabs' => array( 'getting_started' => __( 'Getting Started', 'brilliant' ), 'free_pro' => __( 'Free vs Pro', 'brilliant' ), ), 'utm' => '?utm_source=WordPress&utm_medium=about_page&utm_campaign=' . $my_theme_slug . '_upsell', ); Brilliant_About_Page::init( $config ); /** * Add Upsell "pro" link to the customizer */ require_once( trailingslashit( get_template_directory() ) . '/inc/customize-pro/class-customize.php' );