Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Define site URLs for sub-directory site

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #235066
    Ayanize
    Participant

    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

    #235082
    Alen
    Participant
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.