400, 'width' => 400, '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' ), ) ); /* * 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( 'css/editor-style.css', brilliant_fonts_url() ) ); // Custom template tags for this theme require get_template_directory() . '/inc/template-tags.php'; // Theme Customizer require get_template_directory() . '/inc/customizer.php'; // Load Jetpack compatibility file require get_template_directory() . '/inc/jetpack.php'; } 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 ), ), '//fonts.googleapis.com/css' ); } return $fonts_url; } endif; /** * 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() . '/fonts/elegant-icons.css', array(), '1.0.0' ); // Theme stylesheet. wp_enqueue_style( 'brilliant-style', get_stylesheet_uri(), array(), '1.1.2' ); wp_enqueue_script( 'brilliant-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } wp_enqueue_script( 'brilliant-script', get_template_directory_uri() . '/js/main.js', array( 'jquery' ), '20171006', true ); } 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' => '