css - WordPress admin stylesheet not showing images -


in plugin have styles admin area. originally, doing them in main plugin file, inline, i've enqueued them. stylesheet enqueued properly; styles working, except -- images referenced in stylesheet not show up. when styles inline showed fine, when enqueue stylesheet not show up. it's not issue path because stylesheet in same directory plugin file styles formerly found inline.

here's how i've enqueued it:

function my_style() { wp_register_style( 'style', plugins_url('style.css', __file__) ); wp_enqueue_style( 'style' ); } add_action( 'admin_enqueue_scripts', 'my_style' ); 

and again: enqueue correct because other styles work fine. here example of image in stylesheet:

#mycustom-mb h3:before {     content:url("../wp-content/plugins/my-plugin/images/banner.png"); } 

and same line works when style inline, rather enqueued. wordpress doing weird block images? doesn't give me file not found error in firebug, nor show broken image link in header (like when have bad path). it's not there. , in firebug, firebug doesn't try search image when hover on link, on other images. feels wordpress doing weird images when stylesheet enqueued admin.

i can't regular include either, because, though works fine, gives "unexpected characters" warning message on plugin activiation when have css inline or included.

when using url() inside 1 of css rules, have remember, paths relative stylesheet they're found in.

so, in case of inline styles, path relative /wp-admin/, when load stylesheet found in /wp-content/plugins/my-plugin/style.css, of paths relative /wp-content/plugins/my-plugin/.

therefore in order target correct url @ images found, have use this:

#mycustom-mb h3:before {     content:url("images/banner.png"); } 

i'm using chrome developer tools, know sure displays 404 not found error when rule stylesheet causes browser load image, i'm not sure why firebug not show errors.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -