get( 'Version' ) ); // Enqueue theme stylesheet. wp_enqueue_style( 'golazo-style' ); } endif; add_action( 'wp_enqueue_scripts', 'golazo_styles' ); if ( ! function_exists( 'golazo_block_stylesheets' ) ) : /** * Enqueue per-block stylesheets from assets/css/blocks/. * * Each file is attached to its block with wp_enqueue_block_style(), so the CSS * loads only on pages where that block is present (and in the editor canvas). * Add a "'core/name' => 'file'" pair to extend. * * @since Golazo 1.0 * @return void */ function golazo_block_stylesheets() { $golazo_styled_blocks = array( 'core/separator' => 'separator', 'core/quote' => 'quote', ); foreach ( $golazo_styled_blocks as $block_name => $file_name ) { $golazo_block_css = get_template_directory() . '/assets/css/blocks/' . $file_name . '.css'; wp_enqueue_block_style( $block_name, array( 'handle' => 'golazo-' . $file_name, 'src' => get_template_directory_uri() . '/assets/css/blocks/' . $file_name . '.css', 'path' => $golazo_block_css, 'ver' => wp_get_theme()->get( 'Version' ), ) ); } } endif; add_action( 'init', 'golazo_block_stylesheets' ); if ( ! function_exists( 'golazo_block_styles' ) ) : /** * Register custom block styles. * * Opt-in Separator "Stripes" style (CSS in assets/css/blocks/separator.css); * the default Separator is left untouched so it stays editable. (The Quote * "Portrait" layout needs Columns + an Image, so it's a composition — * see patterns/quote-portrait.php — not a single-block style.) * * @since Golazo 1.0 * @return void */ function golazo_block_styles() { register_block_style( 'core/separator', array( 'name' => 'stripes', 'label' => __( 'Stripes', 'golazo' ), ) ); } endif; add_action( 'init', 'golazo_block_styles' );