I'm currently developing a WordPress plugin and encountering some issues with images. My plugin is located in wp-content/plugins/my-plugin/ directory, and within that, there's a folder named images/test.png - how can I properly reference this image in my code? I prefer not to move the images to the theme directory as it might cause problems for other users who install my plugin!
Here is the basic structure:
myplugin/plugin.php (which includes multiple files...)
myplugin/pluginstyle.css
myplugin/includes/page.php
myplugin/images/test.png
The stylesheet works fine, however, using an image as a background for an element seems to be problematic.
What is the correct way to reference the image within my plugin?
Test output from page.php
<div class="test"><p>hello</p></div>
CSS
.test { background: url(../images/test.png) repeat-x; }
Am I missing something here? Is there a better approach I should be taking? Appreciate any assistance provided!