Since I have been told I cant simply rename the buddypress.css I have to dequeue and enqueue a new one with a different name. I would like to ask for clarification on if this code is right as the file loaded but the layout did not change back to normal and I see no errors in my console so what did I miss?
//* Remove bp-nouveau style add_action( 'wp_enqueue_scripts', 'remove_bp_nouveau_styles', 11 ); function remove_bp_nouveau_styles() { wp_dequeue_style( 'bp-nouveau'); } //* Register and Enqueue Stylesheet function profile_style() { wp_enqueue_style( 'profile-style', get_stylesheet_directory_uri() . '/css/profile.css', false, 'null' ); } add_action( 'wp_enqueue_scripts', 'profile_style' );
Hi David,
Yes, you are right about that.Regards
BrajeshI have another question I have found a few snippets and changed them but I don’t think they are right. The topmost one is supposed to dequeue the style then the one below it is supposed to enqueue and register a new one with BuddyPress with a different name.
//* Remove bp-nouveau style add_action( 'wp_enqueue_scripts', 'remove_bp_nouveau_styles', 11 ); function remove_bp_nouveau_styles() { wp_dequeue_style( 'bp-nouveau'); } //* Register and Enqueue Stylesheet function community_profile() { wp_enqueue_style( 'community-profile', get_stylesheet_directory_uri() . '/css/profile.css', false, null, 'all' ); } add_action( 'wp_enqueue_scripts', 'community_profile' );
Now I also would like to ask is out of these things do you have any idea which is hard-coded? file names,CSS tags,div ids,and div classes.
- This reply was modified 2 years, 11 months ago by
David.
- This reply was modified 2 years, 11 months ago by
Hi David,
The snippet is fine as long as you keep it in your child theme or theme.the problem of hardcoding arises when you keep dependencies at different place. since your css file is contained within your theme directory, I don’t see any issue with it.
Regards
Brajesh
You must be logged in to reply to this topic.