- This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I am running a wordpress site [here](http://bochdewi.co.uk/htmlmainia) and im trying to run php in the style.css with .htaccess but its not working.
Working link: http://bochdewi.co.uk/htmlmainia/
@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.
header(“Content-type: text/css; charset: UTF-8”);
$noUnderline = “none”;
?>
And then right outside the closing PHP tag (?>), place this:
a {text-decoration: ;}
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.
@Htmlmainiac Can you at least answer our questions while ignoring some of our solutions?