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.
- Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
- Open a support ticket if you would like specific help with your account, deposits or purchases.
- Item Support by authors is optional and may vary. Please see the Support tab on each item page.
Most of all, enjoy your time here. Thank you for being a valued Envato community member.