Disable stack for buddypress pages

Hi Everyone.

I’m trying to figure out if there is a efficient way to turn off styles used by Pro for Buddypress. I’m using a community plugin (Youzer) that incorporates its own styles which are important to keep things working cohesively. But there is fair amount of overriding happening from the ICON stack that I’m using, which breaks the styles, therefore the content. I obviously don’t want to remove the stack since I’m happy with it elsewhere.

Any help will be greatly appreciated.

Thank you!

Hello @kgpthemex,

Thanks for writing in!

Please be informed that what you are trying to do is considered custom modifications to the theme and this is beyond the scope of our support. What we can only do is to guide you in getting you started with the changes that you want. First, what you are trying to accomplish requires a template customization, we would highly to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is set up, please review how we recommend making template changes in Customization Best Practices.

By default, we are using this PHP code in the theme to load the styling of the built-in CSS for Buddypress:

// Styles
// =============================================================================

function x_buddypress_enqueue_styles( $stack, $ext ) {
  wp_deregister_style( 'bp-legacy-css' );
  wp_deregister_style( 'bp-admin-bar' );
  wp_enqueue_style( 'x-buddypress', X_TEMPLATE_URL . '/framework/dist/css/site/buddypress/' . $stack . $ext . '.css', NULL, X_ASSET_REV, 'all' );
}

add_action( 'x_enqueue_styles', 'x_buddypress_enqueue_styles', 10, 2 );

To override this function so that the styles will not be loaded, you will simply remove it by adding remove_action() function in your child theme. Check out this codex:

Note: We are unable to provide support for customizations under our Support Policy. If you are unfamiliar with code and resolving potential conflicts, you may select our One or Care service for further assistance.

Best Regards.

@ruenel

Thank you so much for the prompt reply and getting me started. That is what I needed.

I did add the function you provided with the “remove_action” but it seems to break the site, given me the “The site is experiencing technical difficulties.” error.

Thanks

Hey @kgpthemex,

You only need to call the remove_action() function in your child theme. Try adding the following code in your child theme’s functions.php file:

remove_action( 'x_enqueue_styles', 'x_buddypress_enqueue_styles', 10, 2 );

Let us know how this goes!

@nabeel,

Thank you for that. I tried that as well! While it does not break the site, it unfortunately also do not seem to remove the stylesheet. When inspecting, I still see styles being applied from "pro/framework/dist/css/site/buddypress/icon.css?ver=3.2.3 ".

Thanks again!

Hi @kgpthemex,

Although, my colleagues have already mentioned that what you are trying is customization and beyond the scope of theme support, but we’ll be interested to know the issue which is not letting you remove/dequeue the stylesheet.

If you are not familiar with the coding, I would suggest you hire a developer who can assist you to do this customization or you can avail of our newly launched service called One, where the customization questions are answered.

To investigate the issue with the remove_action hook for x_enqueue_styles, please provide login credentials to investigate the issue with remove_action in your site in a secure note to examine it further, including:

– WordPress Site URL & Admin URL
– WordPress Admin username/password

To create a secure note, click the key icon underneath any of your posts.

Thanks

@tristup,

Thank you for getting back to me. I completely understand your point about customization. I do appreciate you guys providing a solution that might work. That is all I’m looking for at this time. Anything beyond this I will certainly avail Themeco’s other services.

The remove action is active at this time. Please see the note for the credentials.

Hi @kgpthemex,

The given credentials is not working, please double check and let us know again.

Thank you.

@cramaton,

Sorry about that. All of a sudden my password stopped working and I had to reset it. Not sure why. Please try the credentials again.

Thank you@

Hey @kgpthemex,

We’re sorry for the confusion here. We don’t need to log in to your site as that would mean we provide support for custom development.

Just ensure that you’re hooking at the right WordPress events. The following code that should be added in your child theme’s functions.php will override our BuddyPress CSS integration. I’ve tested this so surely it will work.

add_action('after_setup_theme', 'remove_x_buddypress');

function remove_x_buddypress() {
  remove_action( 'x_enqueue_styles', 'x_buddypress_enqueue_styles', 10, 2 );  
}

If that doesn’t help, please consult with a developer to investigate why that custom code doesn’t work for your site only.

Hope that helps and thank you for understanding.

@christian,

Thank you so much! That did the trick!

Hi @kgpthemex,

Glad that we are able to help you.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.