esc_html__('Primary Menu', 'approach') )); } } add_action( 'after_setup_theme', 'approach_support' ); /** * Enqueue scripts and styles. */ function approach_scripts_styles() { // Register and Enqueue Stylesheet. wp_enqueue_style( 'approach-stylesheet', get_stylesheet_uri(), array(), wp_get_theme()->get( 'Version' ) ); } add_action( 'wp_enqueue_scripts', 'approach_scripts_styles' ); /** * Block patterns. */ require APPROACH_TEMPLATE_DIR . '/inc/block-patterns.php'; require APPROACH_TEMPLATE_DIR . '/inc/block-styles.php'; // Theme About Page require get_template_directory() . '/inc/about.php'; /** * Enqueue block styles and scripts for Gutenberg Editor. */ function approach_block_scripts() { // Enqueue Editor Styling. wp_enqueue_style( 'approach-editor-styles', get_theme_file_uri( '/assets/css/editor-styles.css' ), array(), wp_get_theme()->get( 'Version' ), 'all' ); } add_action( 'enqueue_block_editor_assets', 'approach_block_scripts' ); /** * Enqueue theme fonts. */ function approach_theme_fonts() { $fonts_url = approach_get_fonts_url(); // Load Fonts if necessary. if ( $fonts_url ) { require_once get_theme_file_path( 'inc/wptt-webfont-loader.php' ); wp_enqueue_style( 'approach-theme-fonts', wptt_get_webfont_url( $fonts_url ), array(), '20201110' ); } } add_action( 'wp_enqueue_scripts', 'approach_theme_fonts', 1 ); add_action( 'enqueue_block_editor_assets', 'approach_theme_fonts', 1 ); /** * Retrieve webfont URL to load fonts locally. */ function approach_get_fonts_url() { $font_families = array( 'Barlow:400,400italic,700,700italic', 'Inter:400,400italic,700,700italic', 'Roboto:400,400italic,700,700italic', ); $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), 'subset' => urlencode( 'latin,latin-ext' ), 'display' => urlencode( 'swap' ), ); return apply_filters( 'approach_get_fonts_url', add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ) ); } /** * Change excerpt length for default posts * * @param int $length Length of excerpt in number of words. * @return int */ function approach_excerpt_length( $length ) { if ( is_admin() ) { return $length; } return apply_filters( 'approach_excerpt_length', 20 ); } add_filter( 'excerpt_length', 'approach_excerpt_length' ); function approach_pattern_content( $content ) { switch ( $content ) { case 'slider-banner': return esc_url( get_theme_file_uri( 'assets/images/slider-banner.jpg' ) ); break; default: return ''; break; } } // Notice for welcome message function approach_admin_plugin_notice_warn() { $theme_name = wp_get_theme(); if ( get_option( 'dismissed-approach_comanion_plugin', false ) ) { return; } if ( function_exists('approach_companion_activate')) { return; }?>