I use wp_enqueue_style to add my stylesheet, like this:
<?php wp_enqueue_style( 'theme-style', get_template_directory_uri() . '/style.php', false, '1.0', 'all' ); ?>
It works fine BUT I need to run a Wordpress function in the style.php file. The stylesheet file does not know that the core exists.
This is what I've heard
- It's bad to include
wp-load.php
. - It's bad to include the stylesheet directly to
header.php
because plugins can't find it. - It's bad to include the stylesheet directly to
wp_head
functions because plugins can't find it.
Is there a "correct" way to do this?