- This topic has 8 replies, 3 voices, and was last updated 2 years, 6 months ago by Clay.
-
AuthorPosts
-
October 21, 2021 at 12:00 pm #1971100Clay
I used this doc to upload fonts: https://docs.generatepress.com/article/adding-local-fonts/
Things seem to have gone well. I can see my fonts in Customizer. The homepage is working just fine, the fonts seem to have taken affect on all areas of the page… then I click into the site, any other navigation item, and the font isn’t rendering, it seems to be defaulting to a Times font or something.
What did I miss?
Thanks,
-ClayOctober 21, 2021 at 12:23 pm #1971128YingStaffCustomer SupportHi Clay,
I tried to compare your home page font and the example of the font, they don’t look the same to me.
https://www.screencast.com/t/s4Me4S8vGpAre you sure the home page is using the UNIVERS LT STD FONT?
Can you share all the codes you used to install this font(please use the
code
option to wrap them so we can see the format as well)?Let me know ๐
October 21, 2021 at 12:31 pm #1971141ClayThe homepage is using the fonts that I were sent… whether that is UNIVERSE LT STD, not entirely sure. I uploaded the font files that I received from the Designer to wp-content/uploads/fonts/
CSS:
@font-face { font-family: UniversLTStd; src: url("wp-content/uploads/fonts/UniversLTStd.otf") format("opentype"); font-weight: normal; font-style: normal; } @font-face { font-family: UniversLTStd; src: url("wp-content/uploads/fonts/UniversLTStd-Bold.otf") format("opentype"); font-weight: bold; font-style: normal; } @font-face { font-family: UniversLTStd Condensed; src: url("wp-content/uploads/fonts/UniversLTStd-Cn.otf") format("opentype"); font-weight: normal; font-style: normal; } @font-face { font-family: UniversLTStd Light; src: url("wp-content/uploads/fonts/UniversLTStd-Light.otf") format("opentype"); font-weight: normal; font-style: normal; }
SNIPPETS:
add_filter( 'generate_typography_default_fonts', function( $fonts ) { $fonts[] = 'UniversLTStd'; $fonts[] = 'UniversLTStd Condensed'; $fonts[] = 'UniversLTStd light'; return $fonts; } );
I was able to select the font in Customizer. I’ve only changed Body and H2 to Univers LT STD.
Thank you!
-ClayOctober 21, 2021 at 12:52 pm #1971159YingStaffCustomer SupportCan you try add
''
to wrap the font names in CSS?
For example, changeUniversLTStd
to'UniversLTStd'
October 21, 2021 at 3:26 pm #1971267ClayI made that change… no change to the fonts on the site.
I feel there may be a misunderstanding… the homepage is good to go (https://cdi.claybeyer.com/)
The other pages are what’s wrong, for example: https://cdi.claybeyer.com/interior-environments/
The entire site switches fonts on every page but the homepage. This is the issue. Homepage is good to go, it’s what I want.
What is wrong with the other pages? Why is the font not taking affect?
Thanks,
-ClayOctober 21, 2021 at 5:27 pm #1971332ElvinStaffCustomer SupportHi Clay,
The issue is with the pathing on the request.
On your the other pages, what happens is the font path changes to the current page permalink +
/wp-content/uploads/fonts/UniversLTStd.otf
. this causes error 404 because the file isn’t found.It should always just be
/wp-content/uploads/fonts/UniversLTStd.otf
That said, can you change the @font-face url importation to not use relative path? Can you try adding the whole URL? (including the domain)
October 22, 2021 at 5:02 am #1971689ClayYes, this now works correctly. I must have misread the instructions and put
src: url("wp-content/uploads/fonts/UniversLTStd-Cn.otf") format("opentype");
instead of
src: url("/wp-content/uploads/fonts/UniversLTStd-Cn.otf") format("opentype");
The site now displays all fonts properly…
Thank you for all the help!
-ClayOctober 24, 2021 at 9:29 pm #1974051ElvinStaffCustomer SupportNice one. No problem. Glad you got it sorted. ๐
October 25, 2021 at 4:41 am #1974320ClayMarking as closed.
-
AuthorPosts
- You must be logged in to reply to this topic.