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( 'primary' => esc_html__( 'Primary', 'brillo' ), ) ); /* * 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', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'brillo_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); /** * 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 theme support for selective refresh for widgets. */ add_theme_support( 'customize-selective-refresh-widgets' ); } endif; add_action( 'after_setup_theme', 'brillo_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 brillo_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( 'brillo_content_width', 640 ); } add_action( 'after_setup_theme', 'brillo_content_width', 0 ); /** * Register custom fonts. */ if ( !function_exists( 'brillo_fonts_url' ) ) : function brillo_fonts_url() { $fonts_url = ''; $fonts = array(); $subsets = 'latin,latin-ext'; /* translators: If there are characters in your language that are not supported by Open Sans, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'brillo' ) ) { $fonts[] = 'Open Sans:300,400,600,700'; } /* translators: If there are characters in your language that are not supported by Poppins, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Poppins font: on or off', 'brillo' ) ) { $fonts[] = 'Poppins:300,400,500,500i,600,700,800'; } if ( $fonts ) { $fonts_url = add_query_arg( array( 'family' => urlencode( implode( '|', $fonts ) ), 'subset' => urlencode( $subsets ), ), 'https://fonts.googleapis.com/css' ); } return $fonts_url; } endif; /** * Enqueue scripts and styles. */ function brillo_scripts() { wp_enqueue_style( 'brillo-font', brillo_fonts_url() ); // Style wp_enqueue_style( 'htflexboxgrid', get_template_directory_uri() . '/assets/css/htflexboxgrid.css'); wp_enqueue_style('mean-menu', get_template_directory_uri() . '/assets/css/lib/meanmenu.min.css'); wp_enqueue_style('theme-style', get_template_directory_uri() . '/assets/css/theme-style.css'); wp_enqueue_style( 'brillo-style', get_stylesheet_uri() ); wp_enqueue_style('responsive', get_template_directory_uri() . '/assets/css/responsive.css'); // Scripts wp_enqueue_script( 'brillo-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array(), '1.0.0', true ); wp_enqueue_script( 'brillo-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix.js', array(), '1.0.0', true ); wp_enqueue_script( 'jquery-mean-menu', get_template_directory_uri() . '/assets/js/jquery.meanmenu.min.js', array('jquery'), '1.0.0', true ); wp_enqueue_script( 'brillo-main', get_template_directory_uri() . '/assets/js/main.js', array(), '1.0.0', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'brillo_scripts' ); /** * Enqueue styles for the block-based editor. */ function brillo_block_editor_styles() { // Block styles. wp_enqueue_style( 'brillo-block-editor-style', get_template_directory_uri() . '/assets/css/editor-blocks.css', array(), '1.0.0' ); // Add custom fonts. wp_enqueue_style( 'brillo-fonts', brillo_fonts_url(), array(), null ); } add_action( 'enqueue_block_editor_assets', 'brillo_block_editor_styles' ); /** * Implement the Custom Header feature. */ require get_template_directory() . '/inc/custom-header.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/customizer/sanitization-callbacks.php'; /** * Load Jetpack compatibility file. */ if ( defined( 'JETPACK__VERSION' ) ) { require get_template_directory() . '/inc/jetpack.php'; } /* * Load widget */ require get_template_directory().'/inc/widgets/widget-register.php'; /* * Global Helpers Function */ require get_template_directory().'/inc/global-functions.php'; /* * Comment form */ require get_template_directory().'/inc/comment-form.php'; /* * Load tgm plugin */ require get_template_directory().'/inc/tgm-plugin/plugins.php';