- This topic has 3 replies, 2 voices, and was last updated 4 years, 3 months ago by
Ying.
-
AuthorPosts
-
December 20, 2021 at 10:06 am #2054756
Gurer
Hi,
I followed and done all the steps in your tutorial but couldn’t achieve to add my font to local.
The font name is Gotham.
1- All files are added in media gallery.
2- I added @font-face below block-editor.css and style.css to child theme.
@font-face {
font-family: ‘Gotham’;
src: url(‘https://www.wpdemopark.com/wp-content/uploads/2021/12/Gotham-Bold.ttf’) format(‘truetype’);
font-weight: bold;
font-style: normal;
font-display: swap;
}@font-face {
font-family: ‘Gotham’;
src: url(‘https://www.wpdemopark.com/wp-content/uploads/2021/12/Gotham-Bold_1.ttf’) format(‘truetype’);
font-weight: bold;
font-style: normal;
font-display: swap;
}@font-face {
font-family: ‘Gotham’;
src: url(‘https://www.wpdemopark.com/wp-content/uploads/2021/12/Gotham-Book.ttf’) format(‘truetype’);
font-weight: normal;
font-style: normal;
font-display: swap;
}@font-face {
font-family: ‘Gotham’;
src: url(‘https://www.wpdemopark.com/wp-content/uploads/2021/12/Gotham-LightItalic.ttf’) format(‘truetype’);
font-weight: 300;
font-style: italic;
font-display: swap;
}@font-face {
font-family: ‘Gotham’;
src: url(‘https://www.wpdemopark.com/wp-content/uploads/2021/12/Gotham-BoldItalic.ttf’) format(‘truetype’);
font-weight: bold;
font-style: italic;
font-display: swap;
}@font-face {
font-family: ‘Gotham’;
src: url(‘https://www.wpdemopark.com/wp-content/uploads/2021/12/Gotham-Book_1.ttf’) format(‘truetype’);
font-weight: normal;
font-style: normal;
font-display: swap;
}@font-face {
font-family: ‘Gotham’;
src: url(‘https://www.wpdemopark.com/wp-content/uploads/2021/12/Gotham-Bold_2.ttf’) format(‘truetype’);
font-weight: bold;
font-style: normal;
font-display: swap;
}@font-face {
font-family: ‘Gotham’;
src: url(‘https://www.wpdemopark.com/wp-content/uploads/2021/12/Gotham-Book_2.ttf’) format(‘truetype’);
font-weight: normal;
font-style: normal;
font-display: swap;
}@font-face {
font-family: ‘Gotham’;
src: url(‘https://www.wpdemopark.com/wp-content/uploads/2021/12/Gotham-Book_3.ttf’) format(‘truetype’);
font-weight: normal;
font-style: normal;
font-display: swap;
}@font-face {
font-family: ‘Gotham’;
src: url(‘https://www.wpdemopark.com/wp-content/uploads/2021/12/Gotham-Medium.ttf’) format(‘truetype’);
font-weight: 500;
font-style: normal;
font-display: swap;
}@font-face {
font-family: ‘Gotham’;
src: url(‘https://www.wpdemopark.com/wp-content/uploads/2021/12/otham-Light.ttf’) format(‘truetype’);
font-weight: 300;
font-style: normal;
font-display: swap;
}@font-face {
font-family: ‘Gotham’;
src: url(‘https://www.wpdemopark.com/wp-content/uploads/2021/12/Gotham-BookItalic.ttf’) format(‘truetype’);
font-weight: normal;
font-style: italic;
font-display: swap;
}3- I added the action
add_action( ‘enqueue_block_editor_assets’, function() {
wp_enqueue_style( ‘your-handle-here’, get_stylesheet_directory_uri() . “/block-editor.css”, false, ‘1.0’, ‘all’ );
} );Can you please help?
Best regards,
GurerDecember 20, 2021 at 11:52 am #2054870Ying
StaffCustomer SupportHi Gurer,
The font URLs are leading to 404 page.
Can you check if the URLs are correct?
December 21, 2021 at 6:18 am #2055502Gurer
Great, problem solved, I appreciate Ying!
December 21, 2021 at 10:25 am #2055952Ying
StaffCustomer SupportYou are welcome 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.