123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <?php
- /**
- * Gutenberg theme support.
- *
- * @package Captivating
- * @author Lauren Gaige // Restored 316 LLC
- * @license GPL-2.0-or-later
- * @link https://www.restored316designs.com/themes
- */
- add_action( 'wp_enqueue_scripts', 'captivating_enqueue_gutenberg_frontend_styles' );
- /**
- * Enqueues Gutenberg front-end styles.
- *
- * @since 2.7.0
- */
- function captivating_enqueue_gutenberg_frontend_styles() {
- $child_theme_slug = defined( 'CHILD_THEME_NAME' ) && CHILD_THEME_NAME ? sanitize_title_with_dashes( CHILD_THEME_NAME ) : 'captivating';
- wp_enqueue_style(
- 'captivating-gutenberg',
- get_stylesheet_directory_uri() . '/lib/gutenberg/front-end.css',
- array( $child_theme_slug ),
- CHILD_THEME_VERSION
- );
- }
- add_action( 'enqueue_block_editor_assets', 'captivating_block_editor_styles' );
- /**
- * Enqueues Gutenberg admin editor fonts and styles.
- *
- * @since 2.7.0
- */
- function captivating_block_editor_styles() {
- wp_enqueue_style(
- 'captivating-gutenberg-fonts',
- 'https://fonts.googleapis.com/css?family=Montserrat:300,300i,400,700,700i|Open+Sans:400,400i,700,700i|Playfair+Display:400,400i,700,700i|Poppins',
- array(),
- CHILD_THEME_VERSION
- );
- }
- // Add support for editor styles.
- add_theme_support( 'editor-styles' );
- // Enqueue editor styles.
- add_editor_style( '/lib/gutenberg/style-editor.css' );
- // Adds support for block alignments.
- add_theme_support( 'align-wide' );
- // Make media embeds responsive.
- add_theme_support( 'responsive-embeds' );
- // Adds support for editor font sizes.
- add_theme_support(
- 'editor-font-sizes',
- array(
- array(
- 'name' => __( 'Small', 'captivating' ),
- 'shortName' => __( 'S', 'captivating' ),
- 'size' => 12,
- 'slug' => 'small',
- ),
- array(
- 'name' => __( 'Normal', 'captivating' ),
- 'shortName' => __( 'M', 'captivating' ),
- 'size' => 16,
- 'slug' => 'normal',
- ),
- array(
- 'name' => __( 'Large', 'captivating' ),
- 'shortName' => __( 'L', 'captivating' ),
- 'size' => 20,
- 'slug' => 'large',
- ),
- array(
- 'name' => __( 'Larger', 'captivating' ),
- 'shortName' => __( 'XL', 'captivating' ),
- 'size' => 24,
- 'slug' => 'larger',
- ),
- )
- );
- add_action( 'after_setup_theme', 'captivating_content_width', 0 );
- /**
- * Set content width to match the “wide” Gutenberg block width.
- */
- function captivating_content_width() {
- // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/924
- $GLOBALS['content_width'] = apply_filters( 'captivating_content_width', 1062 );
- }
|