Home › Forums › Pro Themes › Travel Base Pro › Registering New Google Fonts
- This topic has 2 replies, 2 voices, and was last updated 3 years, 1 month ago by
Jade.
-
AuthorPosts
-
December 12, 2020 at 11:34 pm #140672
Jade
ParticipantHey @support:
Longtime user of WP Travel plugins and Travel Base Pro. Hope your team is staying safe.
Theme: Travel Base Pro 1.0.9
PLugins: Wp Travel 4.4 and WP Travel Utilities 2.1I’d like to register a couple of different Google Fonts, but digging around the
functions.phpfile, I see that this theme approaches registering the fonts differently that I’ve seen before.On line 333 of the
functions.phpfile, I adjusted it to the following:Before:
if ( $fonts ) { $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); }After:
`if ( $fonts ) {
$fonts_url = add_query_arg( $query_args, ‘https://fonts.googleapis.com/css2?family=Anton&family=Oswald:wght@300;400;500;600;700&display=swap’ );
}`This however did not seem to register these fonts. Could you let me know how register new fonts correctly?
Thanks!
December 13, 2020 at 2:17 am #140689Psink
KeymasterHello
We all are safe here. Hope you too staying safe
Regarding your query, i see there you have done little mistake during adding code in the theme. The way you have done to add font is not proper way. So we want you to send fonts name so that we could add it for you in the theme
If you decided to add code yourself you can do just by following my instruction
Add bellow code somewhere above line no. 324 in functions.php
if ( 'off' !== _x( 'on', 'Raleway font: on or off', 'travel-base-pro' ) ) { $fonts[] = 'Raleway'; }As you can see, the above code is for Raleway font. Just replace Raleway font name to font name you are trying to integrate.
And also if you want to add font weight you can add weight as seen in below code
if ( 'off' !== _x( 'on', 'Raleway font: on or off', 'travel-base-pro' ) ) { $fonts[] = 'Raleway:400,500,600,700,800,900'; }Regards,
December 14, 2020 at 2:20 am #140747 -
AuthorPosts
- You must be logged in to reply to this topic.





