get_template_directory has an odd functionality

I have WordPress 4.4 installed localy on wamp server 2.5 x64 on Windows 10 and noticed that:

get_template_directory();

returns this:

'C:\wamp\www\my-site//content/themes/my-theme'

Questions

  1. What’s the reason for those two sequential slashes, if this is not a bug?
  2. Why WordPress does not handle DS correctly (regarding slashes and backslashes)? is this something up to the web server or the script itself?

1 Answer
1

It is a bug the get_template_directory(); should not return a string that looks like that, try making another installation of WordPress, and echo the get_template_directory(); and see if the output is the same, if it is not then there is something wrong with the first installation.

Leave a Comment