I know there are other, maybe better ways to do what I want to achieve, but I have to use this solution.
Alright, I have two stylesheet files: style.css - normal stylesheet
style-dynamic.php - dynamic stylesheet linked to the first one
I'm using some PHP code in the second one, like:
#body {
background-color: <?php echo get_option('theme_background');>;
}
Now the point is style.php file doesn't "know" WP functions, and the code above gives:
Fatal error: Call to undefined function get_option() in C:\xampp\htdocs\wordpress\wp-content\themes\mytheme\style-dynamic.php on line 12
I guess I have to load wp_load.php (only?) and that's tricky, because I'm not sure how exactly? I was trying require once, but I'm not sure I'll be able to jump from theme directory right to the WP main dir where wp-load.php file is?
[edit]
Of course
require_once( ABSPATH . 'wp-load.php');
Outputs another error:
Use of undefined constant ABSPATH - assumed 'ABSPATH'