Relative URLs on a Sub-directory
-
Hi,
I have developed a child theme for public release. The theme directory has its own image folder (images) which contain images like pic.png, pic1.jpg and so.
Now in the theme, while designing pages I used relative URLs on images pointing to the image directory like
/wp-content/themes/theme-name/images/pic.png
Now it works fine when someone installs the theme on his/her site https://www.example.com. The image URLs become
https://www.example.com/wp-content/themes/theme-name/images/pic.png
Now the issue is the sub-directory, like https://www.example.com/sub-folder sites. Then they install the theme, the image URLs become
https://www.example.com/wp-content/themes/theme-name/images/pic.png
But the actual path must be like
https://www.example.com/sub-folder/wp-content/themes/theme-name/images/pic.png
So, all the image links are broken and return 404. Any solution to this.
Thanks
- The topic ‘Relative URLs on a Sub-directory’ is closed to new replies.