Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Custom CSS Changes


Boone Gorges
Keymaster

@boonebgorges

Are you sure that your custom-sample.css file is actually being included? With a file name like ‘custom-sample’, I’m guessing that it might not be. Check out the theme’s main style.css, and see if there’s an @import rule for custom-sample.css (or if there is a rule in any other imported stylesheet).

I’m not sure how bp-social works (it appears to be a premium theme so I can’t look at the code) but if it is a child of bp-default, then you won’t be able to create a “grandchild” theme so that your changes won’t be overridden – WP doesn’t support that. However, you could fake it by dropping a snippet in your bp-custom.php file that looks something like this:

`function bbg_custom_style() {
$myStyleUrl = WP_PLUGIN_URL . ‘/custom.css’;
$myStyleFile = WP_PLUGIN_DIR . ‘/custom.css’;
if ( file_exists($myStyleFile) ) {
wp_register_style(‘myStyleSheet’, $myStyleUrl);
wp_enqueue_style( ‘myStyleSheet’);
}
}
add_action(‘wp_print_styles’, ‘bbg_custom_style’);`

(See https://codex.wordpress.org/Function_Reference/wp_enqueue_style for more info on how to enqueue styles)

Just make sure that you have your custom styles in a file called custom.css in your plugin directory. That should make sure that your styles get loaded, but that they don’t get overwritten by future upgrades to your main theme.

Skip to toolbar