add this in your function.php
// Add main CSS
if ( !function_exists( ‘bp_dtheme_enqueue_styles’ ) ) :
function bp_dtheme_enqueue_styles() {}
endif;
wp_enqueue_style( ‘your-child-theme-name-main’, get_stylesheet_directory_uri() . ‘/style.css’, array(), $version );
Hmm.. got this error:
// Add main CSS if ( !function_exists( ‘bp_dtheme_enqueue_styles’ ) ) : function bp_dtheme_enqueue_styles() {} endif; wp_enqueue_style( ‘cornerstone’, get_stylesheet_directory_uri() . ‘/style.css’, array(), $version );
Warning: Cannot modify header information – headers already sent by (output started at /home/cornerst/public_html/wp-content/themes/cornerstone/functions.php:6) in /home/cornerst/public_html/wp-includes/pluggable.php on line 866
You often get this problem if you put spaces/whitespace after the end of what should just be a code file.
So, for example, at the end of functions.php if you have:
// PHP code
?>
CRLF
CRLF
That will cause the warning above (CRLF is, of course, so you can see I mean carriage return!).
The best way to solve this is NOT to close the PHP in all code files – ie remove the last
?>
The reason this happens is that the carriage returns get treated as part of the HTML output and so get written to the response stream – ie starting to write the headers. However, functions.php (and lots of other files) get processed before some header work is done – hence the problem.
So, the answer is always from the last ?> from any “code only” file.
Ah! Now we are getting somewhere.
Now I’m getting…
// Add main CSS
Warning: Division by zero in /home/cornerst/public_html/wp-content/themes/cornerstone/functions.php on line 7
`<?php
if ( !function_exists( ‘bp_dtheme_enqueue_styles’ ) ) :
function bp_dtheme_enqueue_styles() {}
endif;
wp_enqueue_style( ‘cornerstone’, get_stylesheet_directory_uri() . ‘/style.css’, array(), $version );`
Googled it and sounds like it has something to do with variable declaration, but I haven’t changed any variables in the main code…
Thanks for your help!
Um, I think you’ve used `‘cornerstone’` instead of `’cornerstone’` etc…
The orginal needed ‘backticks’ to stop it changing…..
did you add?:
add_action( ‘wp_print_styles’, ‘bp_dtheme_enqueue_styles’ );
Ah. It was the quote thing. Thanks aces!
Do I need to do that for each style sheet? Now it looks like it subbed out the default stylesheet for that basically blank one.
If you check out the site (www.cornerstonecooking.com) there is no style on it really.
Sorry… still stuck on this. A bit more info. When I inspect the loaded page I can see that it is loading the following stylesheet:
“
That’s automatically being generated in the section. That’s the stylesheet tha tI want to load although I don’t know what the deal is with the ver=20120110.
Anyway, I tried to just change something simple like the
style and it doesn’t load.
Anybody have any other tips? I feel like I’m missing something stupid.