I'm running a WP site on my laptop using localhost, and I often need my coworkers to see it. If they enter my home's IP, they were able to access the site, but all the URL's in WP that used site_url() or similar were echoing out "localhost" which of course didn't work for outsiders.
So I changed WP to use my IP for the site URL which solved that problem, but created another. If I bring my laptop away from home and try to view my site, now all the links appear as http://home-ip/ which isn't available. Furthermore, I'm unable to to get into wp-admin to change the site URL back to localhost since I'm being redirected to http://home-ip/site/wp-admin/.
Is there a way to deal with this without having to constantly change the URL every time I want someone else to access it from outside, or every time I leave the house.