I’m working with a wordpress theme that uses a php file as a stylesheet. It’s linked in the head as:
<link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/user.php" type="text/css">
First I encountered a warning that read
resource interpreted as stylesheet but transferred with mime type text
html.
I managed to get rid of the message by following @F. Calderan instructions on the same subject, however the stylesheet is still not working.
The code on top of the user.php file is:
<?php
/*
* User custom styles
*/
define( 'WP_USE_THEMES', false );
require_once('../../../wp-load.php');
header("Content-type: text/css");
?>
and the file contains some basic rules
.project-view header a {
background-color: <?php echo get_theme_option('background_color'); ?>;
}
to be set via the wordpress admin panel.
Thank you very much for any assistance
You may want to try putting the header information before because when you echo it sends header information automatically as text/html: