views:

81

answers:

0
//This function generates the link tag
function myplugin_generatestylesheet(){ 
   //Form the URL to the css file stored in our plugin directory
   $pluginURL = get_bloginfo('home').'/wp-content/plugins/myplugin/mycss.css';
   //Write it to the browser
   echo '<link href="'.$pluginURL.'" type="text/css" rel="stylesheet" />';
}

//Now we add this function to the wp_head action.
add_action('wp_head','myplugin_generatestylesheet');