Replies
Would you mind going into more detail?
So then what are my options ?
Would I have the same trouble with buddy boss ?
- David on March 22, 2022 at 12:32 am in reply to: dequeue bp-nouveau.css and enqueue a new one #43997
I 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, 12 months ago by
David.
- This reply was modified 2 years, 12 months ago by
- David on March 17, 2022 at 11:32 pm in reply to: dequeue bp-nouveau.css and enqueue a new one #43890
Ok might have found my problem. if I change the .buddypress-wrapper in the css am I correct in assuming that I would have to change the <div class=” to go along with it?
Ok I did get the css file to dequeue and get the one I wanted to rename loaded but for some reason it still looks as if the file did not load. Would you mind telling me if this code looks alright to you?
//* 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 add_action( 'wp_enqueue_scripts', 'enqueue_profile_style_sheet' ); function enqueue_profile_style_sheet() { wp_register_style( 'profile', get_stylesheet_directory_uri() . '/css/profile.css', false, '1.0.0' ); wp_enqueue_style( 'profile' ); }
- This reply was modified 3 years ago by
David.
- This reply was modified 3 years ago by
Really appreciate your response. I do know about the handle but I want to change it. I was told I need to dequeue it then enqueue a new handle I guess? Is that how I need to change it or is there a handle in a file I would also need to edit?
I found out how to use wp_dequeue but how do I set the identifier for the css file?
It’s no problem at all I just appreciate you helping me no matter how crazy my request is. I found some video tutorials about php and php with WordPress over at Envato. I found some code to dequeue the style using a handle. I have tried googling around but I have not been able to find anything about how to dequeue just a single css file. Are there any other files besides the css that the handles apply to when dequeuing a style?
- This reply was modified 3 years ago by
David.
- This reply was modified 3 years ago by