Notifications
Clear all

wpForo 1.x.x [Solved] Customizing CSS file

5 Posts
4 Users
2 Likes
1,575 Views
Posts: 19
Topic starter
(@zmgma)
Eminent Member
Joined: 4 years ago

Hello!

I have read this documents and it helps a lot.

https://wpforo.com/docs/root/forum-themes/theme-customization/

I have one more suggestion.

Please support customized style.css and colors.css like that layout customization.

If I add those two files under theme file > wpforo > classic, that's how it works.

Thank you.

Best regards,

Youzer

4 Replies
Sofy
Posts: 4237
 Sofy
Admin
(@sofy)
Support Team
Joined: 6 years ago

Hi @zmgma,

As I've already mentioned here: https://wpforo.com/community/how-to-and-troubleshooting-2/can-i-change-colors-css-file/ the CSS files are not included in theme overwriting method. I'm really sorry but there is no way to overwrite colors.css and style.css. The only way is using colors settings options in Dashboard > Forums > Settings > Styles admin page.

You should add the custom CSS codes in the "Custom CSS code" textarea.

Posts: 201
 fawp
(@fawp)
Reputable Member
Joined: 5 years ago

Hi @Sofy

 

Over the past few days I have been reading about wpForo style customization and I have come across this thread here.

 

I just want to clarify: you mention here that, at the moment

Posted by: @sofy

CSS files are not included in theme overwriting method. I'm really sorry but there is no way to overwrite colors.css and style.css

yet in this document that mentions theme files I see at the very end of the page:

IMPORTANT: Please don’t use these two files for template style and color customization. These are theme core files and should not be changed. Style should be customized using style.css file.

The last paragraph (in bold) seems to be at odds with the statement above. Is it a matter of amending the documentation in that page, or am I missing something?

 

Many thanks as always,

fawp

2 Replies
Alvina
Moderator
(@alvina)
Joined: 4 years ago

Member
Posts: 1869

@fawp,

There is no way to customize those files.

However, if you're familiar with programming and need to make those changes, please put the following code in the current active theme functions.php file. The code provided below allows you to disable the our CSS files and enable the custom files provided by you.

add_action('wp_enqueue_scripts', function(){
wp_deregister_style('wpforo-style');
wp_register_style('wpforo-style', '/YOUR/CUSTOM/STYLE/CSS/STYLE.CSS', false, 'YOUR_STYLE_VERSION' ); wp_deregister_style('wpforo-widgets');
wp_register_style('wpforo-widgets', '/YOUR/CUSTOM/WIDGET/CSS/WIDGETS.CSS', false, 'YOUR_WIDGET_STYLE_VERSION' ); wp_deregister_style('wpforo-dynamic-style');
wp_register_style('wpforo-dynamic-style', '/YOUR/CUSTOM/COLORS/CSS/COLORS.CSS', false, 'YOUR_COLORS_CSS_VERSION' );
});

Please note the red marked code should be your file path and the version of that file to reset the caches if those exist.

But please note if we update the plugin, and add a new feature that has some relation with styles, you'll not have those new features. Then you will need to go to this file, see changes and manually add it on your CSS file. Or after that customization, you should not update the plugin.

 fawp
(@fawp)
Joined: 5 years ago

Reputable Member
Posts: 201

Ok, thanks @alvina, I understand.