Display images from JS?

You don’t specify how precisely your JS is output. If you are doing this inline from PHP you could just echo required data in place. If it’s just some arbitrary script, loaded as such, then the common practice in WP is to use wp_localize_script() to pass data from PHP runtime to an enqueued script. While … Read more

Background image call problem

UPDATE: Added a third example to show you how to output the path inside a PHP string, per the source code you provided in the comments. There’s nothing wrong with having a full path in your CSS but you want to make sure the path is being dynamically generated by WordPress for the most consistent … Read more