I have enqueued a php file which contains CSS. Everything works except wordpress is throwing a fit when I activate the plugin.
The plugin generated 1230 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.
Here is what I have above my CSS in my php file.
<?php // We'll be outputting CSS header('Content-type: text/css'); ?>
It seems Wordpress is not expecting the CSS inside the PHP file. But it does work. I've read in other places to just add the header content-type text/css and everything should be fine. But Wordpress doesn't like this. Can someone help?
<?php function wpse_129259_enqueue_dynamic_css() { // Grab your variable global $data; ?> <style type="text/css">and then this after the CSS</style> <?php } add_action( 'wp_head', 'wpse_129259_enqueue_dynamic_css' );- bagarangmeetsruffio