- This topic has 2 replies, 2 voices, and was last updated 3 years, 11 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Home › Forums › Pro Themes › Travel Base Pro › Registering New Google Fonts
Hey @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.1
I’d like to register a couple of different Google Fonts, but digging around the functions.php
file, I see that this theme approaches registering the fonts differently that I’ve seen before.
On line 333 of the functions.php
file, 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!
Hello
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,
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |