$logo_height, 'width' => $logo_width, 'flex-width' => true, 'flex-height' => true, ) ); // Register Navigation menus. register_nav_menus( array( 'primary' => esc_html__( 'Primary Menu', 'aino' ), ) ); // Add support for Block Styles. add_theme_support( 'wp-block-styles' ); // Add support for editor styles. add_theme_support( 'editor-styles' ); // Enqueue editor styles. add_editor_style( array( 'style-editor.min.css', aino_fonts_url() ) ); // Add support for experimental link colour in blocks. add_theme_support('experimental-link-color'); // Add support for custom custom line-heights in blocks. add_theme_support( 'custom-line-height' ); // Add support for custom units in blocks. add_theme_support( 'custom-units' ); // Remove core block patterns, since Aino ships its own patterns via the Aino blocks plugin. remove_theme_support( 'core-block-patterns' ); // Add support for the WooCommerce eCommerce plugin. add_theme_support( 'woocommerce', array( 'thumbnail_image_width' => 600, 'single_image_width' => 1200, ) ); // Disable WooCommerce default styling. add_filter( 'woocommerce_enqueue_styles', '__return_false' ); remove_theme_support( 'wc-product-gallery-zoom' ); remove_theme_support( 'wc-product-gallery-lightbox' ); remove_theme_support( 'wc-product-gallery-slider' ); } endif; add_action( 'after_setup_theme', 'aino_setup' ); /** * Enqueue scripts and styles. */ function aino_scripts() { // Enqueue fonts stylesheet. wp_enqueue_style( 'aino-fonts', aino_fonts_url(), array(), wp_get_theme()->get( 'Version' ) ); // Theme stylesheet. wp_enqueue_style( 'aino-style', get_template_directory_uri() . '/style.min.css', false, wp_get_theme()->get( 'Version' ) ); } add_action( 'wp_enqueue_scripts', 'aino_scripts' ); /** * Get Google fonts. */ /** * Register custom fonts. */ function aino_fonts_url() { $fonts_url = ''; /* * Translators: If there are characters in your language that are not * supported by Arimo, translate this to 'off'. Do not translate * into your own language. */ $arimo = esc_html_x( 'on', 'Arimo font: on or off', 'aino' ); if ( 'off' !== $arimo ) { $font_families = array(); if ( 'off' !== $arimo ) { $font_families[] = 'Arimo:ital,wght@0,400;0,700;1,400;1,700&display=swap'; } $query_args = array( 'family' => rawurlencode( implode( '|', $font_families ) ), 'subset' => rawurlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); } return esc_url_raw( $fonts_url ); } // Custom template tags for this theme. require get_template_directory() . '/inc/template-tags.php'; /** * Customizer additions. */ require get_template_directory() . '/inc/customizer/defaults.php'; require get_template_directory() . '/inc/customizer/customizer.php'; require get_template_directory() . '/inc/customizer/sanitization-callbacks.php'; // SVG icons functions and filters. require get_parent_theme_file_path( '/inc/icon-functions.php' ); // Aino Block Patterns. require get_template_directory() . '/inc/block-patterns.php'; // Aino Block Styles. require get_template_directory() . '/inc/block-styles.php'; /** * TGMPA plugin activation. */ require_once get_template_directory() . '/inc/classes/class-tgm-plugin-activation.php'; add_action( 'tgmpa_register', 'aino_register_required_plugins' ); /** Add a checkbox to hide the Site Editor */ require get_template_directory() . '/inc/disable-site-editor.php'; /** * Register the required plugins for this theme. */ function aino_register_required_plugins() { /* * Array of plugin arrays. Required keys are name and slug. */ $plugins = array( array( 'name' => 'Gutenberg', 'slug' => 'gutenberg', 'required' => true, ), array( 'name' => 'Aino Blocks - Creative Block Collection', 'slug' => 'aino-blocks', 'required' => true, ), ); /* * Array of configuration settings. Amend each line as needed. */ $config = array( 'id' => 'aino', // Unique ID for hashing notices for multiple instances of TGMPA. 'default_path' => '', // Default absolute path to bundled plugins. 'menu' => 'tgmpa-install-plugins', // Menu slug. 'has_notices' => true, // Show admin notices or not. 'dismissable' => true, // If false, a user cannot dismiss the nag message. 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. 'is_automatic' => false, // Automatically activate plugins after installation or not. 'message' => '', // Message to output right before the plugins table. ); tgmpa( $plugins, $config ); }