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 8, 2021
1 parent 715f0e3 commit ed1c480
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 37 deletions.
28 changes: 24 additions & 4 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,30 @@ function twentytwentytwo_support() {
* Enqueue scripts and styles.
*/
function twentytwentytwo_styles() {
// 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.
$theme_version = wp_get_theme()->get( 'Version' );
$version_string = is_string( $theme_version ) ? $theme_version : false;
wp_enqueue_style( 'twentytwentytwo-style', get_template_directory_uri() . '/style.css', array(), $version_string );
wp_enqueue_style( 'twentytwentytwo-style' );
}
add_action( 'wp_enqueue_scripts', 'twentytwentytwo_styles' );
endif;
Expand All @@ -41,4 +61,4 @@ function twentytwentytwo_editor_styles() {
);
}
add_action( 'admin_init', 'twentytwentytwo_editor_styles' );
endif;
endif;
33 changes: 0 additions & 33 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +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');
}

@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');
}

0 comments on commit ed1c480

Please sign in to comment.