WordPress.org

Ready to get started?Download WordPress

Forums

My Custom CSS
How to reference image paths used with rest of theme? (2 posts)

  1. mcheck
    Member
    Posted 9 months ago #

    How does one use a css background image stored in the theme?
    Whenever url() is used, the base path results from the location of the plugin, rather than the location of the theme being used.

    { background: url('images/border-img.png') 0 0 repeat-x; }

    The result is:
    http://www.mysite.com/wp-content/plugins/my-custom-css/images/layout/border-img.png)

    Would like it to use the images I have stored and use for the rest of the theme at:
    http://www.mysite.com/wp-content/themes/my-theme-name/images/border-img.png

    And if it could correctly manage child themes by finding the base directory using:
    <?php echo get_stylesheet_directory_uri() ?>

    http://wordpress.org/plugins/my-custom-css/

  2. DarkWolf
    Member
    Plugin Author

    Posted 9 months ago #

    it use reference from plugin directory... i think is best to use absolute url or try to move in sup_dir from 2level with "../../images/border-img.png" ;)

Reply

You must log in to post.

About this Plugin

About this Topic

Tags