The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
How to Use Custom F...
 
Share:
Notifications
Clear all

[Solved] How to Use Custom Fonts

7 Posts
2 Users
0 Reactions
2,067 Views
Posts: 36
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@deewinc)
Trusted Member
Joined: 5 years ago
[#5402]

Hello guys, 

Is there a way to force WpDiscuz to use custom fonts? I took the default font file it comes with and modified a bit to remove fonts/icons/characters that I will never use. 

The outcome is a font file with a size of 4KB down from 75KB, which results in unused CSS issues on Core Web Vitals test. 

What I'm doing now is pretty stone age by replacing the default font on WpDiscuz root folder with my edited file. 

But I have to repeat this all the time when developers push an update for the plugin. 

How can I go around this and permanently force my font file and still be able to update the plugin without the need to replace the file.


6 Replies
Asti
Posts: 8210
 Asti
Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@asti)
Illustrious Member
Joined: 8 years ago

Hi,

Please clarify a bit, which CSS file are you referring to?


Posts: 36
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@deewinc)
Trusted Member
Joined: 5 years ago

The font file is huge, and Core Web Vitals lists it as a cause for unused CSS. Once I use my stripped-down font version, the unused CSS issue on Core Web Vitals doesn't show up. 

So, I want to use my stripped-down font without the need to replace it on the WpDicuz root folder. 

 

Is there a way I can achieve this? 


1 Reply
Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8210
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

You can disable the "Load Font Awesome css lib" option in the wpDiscuz settings. 

Then enqueue your qustom CSS fonts. 


Posts: 36
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@deewinc)
Trusted Member
Joined: 5 years ago

Any idea how to do it?


2 Replies
Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8210
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

Hello deewinc,

1. Put the custom font CSS file into your current theme.  

2. Add the following code in the active theme functions.php file: 

add_action('wp_enqueue_scripts', 'my_style');
function my_style() {
   wp_enqueue_style('my_style', get_template_directory_uri() . '/my-style.css', array(), '1.0.0');
}

3. Change the red-marked filename to your custom font CSS filename.


Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8210
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

We have not received a reply from you for over a couple of weeks, therefore we will be closing this topic. Please create a new one if you require any additional help.

Thank You!


Share: