user1751366
user1751366

Reputation: 1

Server does not recognize PHP stylesheet

I am currently working with a Wordpress theme that uses a PHP file as the main stylesheet (style.php). I guess this is because of the fact that you can do a lot of css styling through the CMS of the theme.

Now the problem is the fact that my server does not recognizes the php file as the main stylesheet, so the website is loaded without any styled elements.

Can somebody tell me how I can fix that? (through the use of an .htaccess file maybe?)

Upvotes: 0

Views: 189

Answers (1)

Samuel Cook
Samuel Cook

Reputation: 16828

You must ensure that you add the correct "text/css" header to the top of the php page, in order for it to be parsed as CSS.

header("Content-type: text/css");

Then you can include the php file as a css include:

Upvotes: 2

Related Questions