Hey guys and gals,
I’m having trouble with something. I’m saving a css file via php with this code:
Now I need to include wp-blog-header.php in order to use Wordpress’s functions so It now looks like this:
include '../../../wp-blog-header.php'; header("Content-type: text/css");
After these lines of code I have some basic CSS styling and it all works fine on my host, hosted by heartinternet and my local server which is on my PC. However on some hosts I get the error:
Warning: Cannot modify header information - headers already sent by (output started at /bla bla bla) in /bla bla bla/colours.php on line 3
Why would this error happen on only SOME hosts? I just don’t understand.
Thank you in advance.
Hi, try including wp-load.php instead.
Hi, add this line below the
ob_flush(); // add this linethen before the ending
This should fix the problem.