Ryan Potter
Ryan Potter

Reputation: 835

Wordpress dynamic CSS with wp-load

I have a dynamic css file that pulls information from the database e.g

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

require_once('../../../../wp-load.php');

if ( get_option(PREFIX."_theme_base_color") <> "" ){
    $default_theme_colour = html_entity_decode(get_option(PREFIX."_theme_base_color"),ENT_QUOTES, "UTF-8"); 
} else {
    $default_theme_colour = 'a3f088';
};

but I really hate using require_once('../../../../wp-load.php'); and there has to be a better way to loat "wp-load" into the file.

Upvotes: 3

Views: 468

Answers (1)

krembo99
krembo99

Reputation: 1479

it seems that you are using some kind of plugin , or theme with plugin codes.

If you are the developer , you can read here :

http://ottopress.com/2010/dont-include-wp-load-please/

At any case ,you can use bloginfo('wpurl'); or is you have set a BASENAME than **plugin_basename($file); **

if you are a simple user ,I suggest you leave that as it is .

Upvotes: 1

Related Questions