Skip to content

Instantly share code, notes, and snippets.

@theMikeD
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theMikeD/084abf3be77deb09ff02 to your computer and use it in GitHub Desktop.
Save theMikeD/084abf3be77deb09ff02 to your computer and use it in GitHub Desktop.
Code to specify a location for Wordpress's wp-content folder. Goes into wp-config.php
$md_http = ($_SERVER['HTTPS']) ? 'https://': 'http://';
// MD: Note that $_SERVER['DOCUMENT_ROOT'] will return a string with a trailing slash on
// some systems and not others, so we'll make sure it's gone in all cases where there
// is ambiguity by using rtrim
define('WP_CONTENT_DIR', rtrim($_SERVER['DOCUMENT_ROOT'],"/") . '/wp-content');
define('WP_CONTENT_URL', $md_http . rtrim($_SERVER['SERVER_NAME'],"/") . '/wp-content');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment