Relative or dynamic site url possible?

I usually just avoid the issue entirely every time I create a new wordpress site: define(‘WP_HOME’, “https://wordpress.stackexchange.com/”); define(‘WP_SITEURL’, “https://wordpress.stackexchange.com/”); will cause wordpress to use root-relative urls for everything. Makes site migrations to other domains far easier. Ofc, if you access your site using a folder (eg. “http://<domain>/blog“) you could change them to: define(‘WP_HOME’, ‘/blog/’); define(‘WP_SITEURL’, … Read more

How to run Jetpack from localhost? [closed]

Add this to your wp-config.php: const JETPACK_DEV_DEBUG = TRUE; This makes it possible to use features on localhost that don’t require a connection to wordpress.com. See the announcement post on jetpack.me for the background. For your own plugins, learn that lesson: Do not rely on working outgoing connections. Respect your users privacy, and explain in … Read more

How to deal with WordPress on localhost

You can use wp-config.php to change the site url depending on where the site is accesed from, using $_SERVER[‘REMOTE_ADDR’]. Mine has something like this: if ($_SERVER[‘REMOTE_ADDR’] == ‘127.0.0.1’ || $_SERVER[‘REMOTE_ADDR’] == ‘::1’) { // accesing site from my local server define(‘WP_SITEURL’, ‘http://localhost/mysite/’); define(‘WP_HOME’, ‘http://localhost/mysite’); } else if (strpos($_SERVER[‘REMOTE_ADDR’],’192.168.0.’) !== false) { // accesing site from … Read more

Jetpack Running Locally [closed]

As of JetPack 2.2.1 there is now a local development/debug mode. http://jetpack.me/2013/03/28/jetpack-dev-mode-release/ use: define (‘JETPACK_DEV_DEBUG’, true); in your wp-config and you should have access to any modules that don’t require a connection to function. Update, since around v3.3 another local development trigger was added via filter instead of define. Latest is now here: http://jetpack.me/support/development-mode/ Development … Read more