WordPress.org

Support

Support » Themes and Templates » [Resolved] admin skin plugin question

[Resolved] admin skin plugin question

  • I’m skinning the admin section of my blog and have written a plugin to point to my keen new stylesheet. Because this is based on the Kubrick theme, the buttons and section separators in write and edit post are Kubrick-blue. That’s because they use a background image specified in the stylesheet.

    So, cool that WP looks at my new stylesheet. Question: How do I specify a plugin-directory-relative url for an image. Example:

    background: #7abf00 url(images/box-head-right.gif) no-repeat top right;

    This is right out of the stylesheet and presumes that images is relative to wp-admin. I don’t really know where the plugin will live. How are people solving this problem?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Instead of providing all your css declarations in a separate stylesheet, one way around this is to slip the *tricky ones* into your own <style> section of the <head> by way of the ‘admin_head’ hook. That way you can dynamically set a full url to the image, i.e.:

    echo "background: #7abf00 url(" . get_settings('siteurl') . "/wp-content/plugins/myplugindir/images/box-head-right.gif)n";

    etc…

    A good solution.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] admin skin plugin question’ is closed to new replies.
Skip to toolbar