New Landing How can we help? Themeforest Theme Support Neighborhood cannot override Responsive.css file

Viewing 12 posts - 1 through 12 (of 12 total)
  • #192541
    jbordersfl
    Member
    Post count: 22

    i notice when checking the source code, that “responsive.css” is called AFTER my custom css file from my child theme.

    (evidenced by attached screenshot)

    so the only way to make adjustments is to alter the original theme files, which i should not have to do, and get replaced on every update.

    i believe this must be a bug of sorts, can you please respond when able. thank you.

    Attachments:
    You must be logged in to view attached files.
    #192563
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Try to use our specific option for the custom css in the theme options, the updates would not cause any problem using that option.

    Let us know the result.

    -Rui

    #192947
    jbordersfl
    Member
    Post count: 22

    this did work, thanks.

    it’s a bit of a hack though, as a parent’s CSS should never override the child theme’s. and now i have custom CSS is both the admin area, as well as my child theme’s style.css file which isn’t ideal, but does appear to function.

    #193007
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Great thanks to Rui.
    With Best Regards
    Mohammad

    #197562
    studio34
    Member
    Post count: 1

    I am not a fan of having CSS put in any sort of Dashboard panel. It’s impossible to maintain. I used the following in my functions.php file to ensure that the child theme was added last.

    	function nhood_child_enqueue_styles() {
    		wp_enqueue_style( 'nhood-child-style', get_stylesheet_directory_uri() . '/style.css' );
    		
    	}
    	add_action( 'wp_enqueue_scripts', 'nhood_child_enqueue_styles', 100 );
    

    It’s not ideal as your child theme style gets loaded twice, but it works for me.

    #197563
    jbordersfl
    Member
    Post count: 22

    Ugh. well thanks for the tip for sure. the theme’s already huge, i’d hate to load the child twice.

    is there ANY earthly reason why the child theme does not load last by default???

    support crew? this seems ridiculous to me.

    #197577
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Not sure if you guys are using the latest child theme version, where we don’t have anymore the the import of the style.css of the parent theme, but we use the enqueue of the parent one.

    Do you have this code below in the functions.php of the child theme?

    
    	/* LOAD PARENT THEME STYLES
    	================================================== */
    	function neighborhood_child_enqueue_styles() {
    	    wp_enqueue_style( 'neighborhood-parent-style', get_template_directory_uri() . '/style.css' );
    	
    	}
    	add_action( 'wp_enqueue_scripts', 'neighborhood_child_enqueue_styles' );
    

    This is the recommended way to do it in WordPress child themes
    https://codex.wordpress.org/Child_Themes

    You can enqueue a different css file like a custom.css in the child theme.

    -Rui

    #197604
    jbordersfl
    Member
    Post count: 22

    thank you for the info. i was unaware of this new child theme necessity. i will give it a try.

    the problem is the “responsive.css” file that loads lasts currently, hopefully this technique will override that and load the child’s css last. will update when i can get the child functions.php implemented.

    thanks.

    #197616
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi there,

    Unfortunately this is a tricky situation – responsive css needs to load after style.css else the responsive styles wouldn’t take precedent. The style.css file is loaded before in the parent theme, and this is why when you use a child theme it is before. I’ll see if we can add in a workaround to move the style.css after if a child theme is being used.

    – Ed

    #197617
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Just sorted this for the next update, will likely send this out over the weekend.

    – Ed

    #198286
    jbordersfl
    Member
    Post count: 22

    great, thanks. will look for the update.

    #198346
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi @jbordersfl

    Have had to backtrack on this – unfortunately not as easy as I first thought. Best bet might be to use Better WordPress Minify – then you can choose the order of the output of files?

    – Ed

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register