themes - how can I add a css for my plugin in wordpress? -


this question may seem dummy, found info on codex (its first project on wordpress) , want style admin , frontend... wrote can use this

wp_register_style( 'uni-bootstrap', ds.'plugins'.ds.'uni-info'.ds.'css'.ds.'bootstrap.min.css' ); wp_enqueue_style('uni-bootstrap'); 

i named ds variable, in case linux or windows (directory slash) , still, on loaded page, , route correct, no slashes. try write them own "/" , still, no success..

i absolute path, when see loads says undefined

so, changed , try other way(for admin only)

add_action( 'admin_head', 'admin_css' ); function admin_css(){         echo '<link rel="stylesheet" type="text/css" href="mypath">'; } 

still, same undefined result, dont know how load it, , how use paths, due dont know how wordpress manage folders , on, idea?

add_action( 'wp_enqueue_scripts', 'register_plugin_styles' );  function register_plugin_styles() {     wp_register_style( 'my-plugin', plugins_url( 'my-plugin/css/plugin.css' ) );     wp_enqueue_style( 'my-plugin' ); } 

and admin

add_action( 'admin_enqueue_scripts', 'register_plugin_styles' ); 

Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -