The problem I'm having is that my Wordpress is set up on localhost, but when I view the site from another computer,

"<?php echo get_template_directory_uri();?>/image.png"

will return


which of course doesn't load. But it all works fine when the Wordpress is viewed locally, or put onto a web server and viewed from any computer.

Similar issue with site_url()


Do you have to use localhost for any particular reason? The easiest fix for this will be to make those functions work correctly by putting a real hostname or ip address into the site address field in WordPress settings. Look in Settings > General Settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.