The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
How to Use Custom F...
 
Share:
Notifications
Clear all

[Solved] How to Use Custom Fonts

7 Posts
2 Users
0 Reactions
1,093 Views
Posts: 36
Topic starter
(@deewinc)
Trusted Member
Joined: 4 years ago

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: 7571
 Asti
Support
(@asti)
Illustrious Member
Joined: 7 years ago

Hi,

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

Posts: 36
Topic starter
(@deewinc)
Trusted Member
Joined: 4 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: 7 years ago

Illustrious Member
Posts: 7571

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

Then enqueue your qustom CSS fonts. 

Posts: 36
Topic starter
(@deewinc)
Trusted Member
Joined: 4 years ago

Any idea how to do it?

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

Illustrious Member
Posts: 7571

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: 7 years ago

Illustrious Member
Posts: 7571

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: