get_template_directory_uri() sometimes returns url without ‘www’
-
I have some svg images, and some javascript code on a page that uses the get_template_directory_uri() function to generate a url.
Site is setup with with settings for WordPress Address and Site Address using ‘www’ in the url. Browser address bar always displays ‘www’.
Oddly, get_template_directory_uri() returns the url without ‘www’ at times. When this happens, the only thing that seems to solve the issue is to login to wp-admin. Once I log in, get_template_directory_uri() returns the correct url including the ‘www’. If I then log out, it will continue to return the correct url for a day or so. If I visit the site from a browser that has never logged in after logging in on another browser, I will also get the correct address from get_template_directory_uri(). The effect only seems to last a little while though. Within a day or so get_template_directory_uri() will start returning the url without ‘www’ again.
The page I need help with: [log in to see the link]
- The topic ‘get_template_directory_uri() sometimes returns url without ‘www’’ is closed to new replies.