I've found a couple ways to do this. You can either tell your server to rewrite a *.css request to look at a PHP script (such as "style.php?name=style"). The other way you can do this is by configuring .css files to be handled by php. I think this .htaccess code should work:
php_value default_mimetype "text/css"
Make sure this .htaccess is at least in the same directory as your css php script.
@DustinWoods The problem is that i run wordpress so it cant be style.php it has to be style.css and i used the code from Chris on this site but it didnt work.
I am running a wordpress site here and im trying to run php in the style.css with .htaccess but its not working.
Working link: http://bochdewi.co.uk/htmlmainia/
oops sory for that.
@htmlmainiac Can we see your style.css file?
Edit: Oops. I meant your .htaccess file.
It seems it's working since I see styling on your site. What's not working for you?
Try adding this piece of code in place of yours at the top of your style.css file.
And then right outside the closing PHP tag (?>), place this:
It's style.css because that is what I need for Wordpress but the code is not running.
Just look at it there is php at the top
I don't see any PHP. PHP shouldn't output as PHP unless there's an error in your code. Is the htaccess file in the same place as your style.css?
I've found a couple ways to do this. You can either tell your server to rewrite a *.css request to look at a PHP script (such as "style.php?name=style"). The other way you can do this is by configuring .css files to be handled by php. I think this .htaccess code should work:
php_value default_mimetype "text/css"Make sure this .htaccess is at least in the same directory as your css php script.
@DustinWoods The problem is that i run wordpress so it cant be style.php it has to be style.css and i used the code from Chris on this site but it didnt work.
@Htmlmainiac Can you at least answer our questions while ignoring some of our solutions?