Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › cannot override Responsive.css file
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › cannot override Responsive.css file
Tagged: child, Child Theme, responsive
- This topic has 11 replies, 5 voices, and was last updated 9 years by Swift Ideas – Ed.
-
Posted in: Neighborhood
-
July 7, 2015 at 9:00 pm #192541
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.July 7, 2015 at 11:00 pm #192563Hi,
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
July 8, 2015 at 9:13 pm #192947this 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.
July 9, 2015 at 7:28 am #193007Hi,
Great thanks to Rui.
With Best Regards
MohammadJuly 24, 2015 at 9:22 pm #197562I 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.
July 24, 2015 at 9:32 pm #197563Ugh. 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.
July 24, 2015 at 10:29 pm #197577Not 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_ThemesYou can enqueue a different css file like a custom.css in the child theme.
-Rui
July 25, 2015 at 1:18 am #197604thank 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.
July 25, 2015 at 3:06 am #197616Hi 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
July 25, 2015 at 3:12 am #197617Just sorted this for the next update, will likely send this out over the weekend.
– Ed
July 27, 2015 at 8:12 pm #198286great, thanks. will look for the update.
July 28, 2015 at 1:01 am #198346Hi @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
-
Posted in: Neighborhood
You must be logged in and have valid license to reply to this topic.