Notifications
Clear all

wpForo 1.x.x [Closed] Remove CSS from non wpForo page

4 Posts
2 Users
0 Reactions
1,069 Views
Posts: 2
Topic starter
(@braviking)
New Member
Joined: 3 years ago

Hello,

Wpforo adds the following css files in the header of ALL posts and pages, and not just on wpforo pages:

 

 

How can I remove the css from non wpforo pages?

I did not enable any widgets or addons.

 
Topic Tags
3 Replies
Robert
Posts: 10544
Admin
(@robert)
Support Team
Joined: 8 years ago

Hi @braviking,

These are wpForo widgets CSS files. wpForo widgets can be displayed in any page, not only in forum page. The widget is a site-wide component, so the widget supporting CSS is loaded side-wide as well.

Posts: 2
Topic starter
(@braviking)
New Member
Joined: 3 years ago

thx for explaining.

I will not use wpForo widgets on my site. How can I de-register the style from the head? Whats its handle?

function wp_deregister_style( $handle ) {
    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );
 
    wp_styles()->remove( $handle );
}
1 Reply
Robert
Admin
(@robert)
Joined: 8 years ago

Support Team
Posts: 10544

@braviking,

wpForo doesn't have option to deregister them. Here is a good article about that: https://crunchify.com/wordpress-tip-how-to-disable-specific-plugins-stylesheet/

IMPORTANT: The /wpforo/wpf-themes/classic/colors.css file is also used by forum page, so you should not disable it for all pages, it should be kept for the forum page. The forum page could be checked with this function:

if(function_exists('is_wpforo_page') && !is_wpforo_page()) {
    // your deregister css code....
}