Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
Fix font paths
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Oct 7, 2021
1 parent 2cb7532 commit 216d99c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 39 deletions.
26 changes: 24 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,30 @@ function twentytwentytwo_support() {
* Enqueue scripts and styles.
*/
function twentytwentytwo_scripts() {
// The @font-face styles.
$font_face_css = "@font-face{
font-family: 'Source Serif Pro';
font-weight: 200 900;
font-style: normal;
font-stretch: normal;
src: url('" . get_theme_file_uri( 'assets/fonts/source-serif-pro/SourceSerif4Variable-Roman.ttf.woff2' ) . "') format('woff2');
}
@font-face{
font-family: 'Source Serif Pro';
font-weight: 200 900;
font-style: italic;
font-stretch: normal;
src: url('" . get_theme_file_uri( 'assets/fonts/source-serif-pro/SourceSerif4Variable-Italic.ttf.woff2' ) . "') format('woff2');
}";

// Register theme stylesheet.
wp_register_style( 'twentytwentytwo-style', '' );
// Add styles inline.
wp_add_inline_style( 'twentytwentytwo-style', $font_face_css );
// Enqueue theme stylesheet.
wp_enqueue_style( 'twentytwentytwo-style', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->get( 'Version' ) );
wp_enqueue_style( 'twentytwentytwo-style' );

}
add_action( 'wp_enqueue_scripts', 'twentytwentytwo_scripts' );

Expand All @@ -35,4 +57,4 @@ function twentytwentytwo_editor_styles() {
)
);
}
add_action( 'admin_init', 'twentytwentytwo_editor_styles' );
add_action( 'admin_init', 'twentytwentytwo_editor_styles' );
37 changes: 0 additions & 37 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,3 @@ Text Domain: twentytwentytwo
Twenty Twenty-Two WordPress Theme, (C) 2021 WordPress.org
Twenty Twenty-Two is distributed under the terms of the GNU GPL.
*/

/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
0. Fonts
----------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------- */
/* 0. Fonts
/* -------------------------------------------------------------------------- */

/*
* Fonts can be reworked if this core issue is resolved:
* https://github.com/WordPress/wordpress-develop/pull/1573
*/

@font-face{
font-family: 'Source Serif Pro';
font-weight: 200 900;
font-style: normal;
font-stretch: normal;
src: url('/wp-content/themes/twentytwentytwo/assets/fonts/source-serif-pro/SourceSerif4Variable-Roman.ttf.woff2') format('woff2'),
url('/wp-content/themes/twentytwentytwo/assets/fonts/source-serif-pro/SourceSerif4Variable-Roman.ttf.woff') format('woff'),
url('/wp-content/themes/twentytwentytwo/assets/fonts/source-serif-pro/SourceSerif4Variable-Roman.ttf') format('truetype');
}

@font-face{
font-family: 'Source Serif Pro';
font-weight: 200 900;
font-style: italic;
font-stretch: normal;
src: url('/wp-content/themes/twentytwentytwo/assets/fonts/source-serif-pro/SourceSerif4Variable-Italic.ttf.woff2') format('woff2'),
url('/wp-content/themes/twentytwentytwo/assets/fonts/source-serif-pro/SourceSerif4Variable-Italic.ttf.woff') format('woff'),
url('/wp-content/themes/twentytwentytwo/assets/fonts/source-serif-pro/SourceSerif4Variable-Italic.ttf') format('truetype');
}

0 comments on commit 216d99c

Please sign in to comment.