Hello,
I have developed a child theme which has some pre-designed page layouts. I have stored the theme images in a theme directory called images and used image path like this
/wp-content/themes/mytheme/images/an-image.png.
It works fine. When the theme is installed in a user site, the image path takes the user site and makes it an absolute URL like
http://www.their-site.com /wp-content/themes/mytheme/images/an-image.png
Now the problem happens when the user site is on a sub-directory. Like
http://www.their-site.com/sub-directory/
The path is then broken making the image path like this
http://www.their-site.com /sub-directory//wp-content/themes/mytheme/images/an-image.png
If I remove the first forward slash (/) from the pages, then it works.
Is there any function or way to solve this issue? Thanks