BuddyDev

Search

dequeue bp-nouveau.css and enqueue a new one

  • Participant
    Level: Enlightened
    Posts: 64
    David on #43849

    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' );
    
  • Participant
    Level: Enlightened
    Posts: 64
    David on #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?

  • Keymaster
    (BuddyDev Team)
    Posts: 21801
    Brajesh Singh on #43914

    Hi David,
    Yes, you are right about that.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 64
    David on #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 6 months, 1 week ago by David.
  • Keymaster
    (BuddyDev Team)
    Posts: 21801
    Brajesh Singh on #44056

    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.

This topic is: not resolved