WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] admin skin plugin question (3 posts)

  1. cwd
    Member
    Posted 7 years ago #

    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?

  2. Kafkaesqui

    Posted 7 years ago #

    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...

  3. cwd
    Member
    Posted 7 years ago #

    A good solution.

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags