Skip to content

Instantly share code, notes, and snippets.

@peteboere
Created March 9, 2011 17:27
Show Gist options
  • Save peteboere/862598 to your computer and use it in GitHub Desktop.
Save peteboere/862598 to your computer and use it in GitHub Desktop.
Bootstrap wordpress from any wp installation sub-directory
<?php
if ( !defined( 'ABSPATH' ) ) {
$search = 'wp-load.php';
$limit = 20; // Avoid infinite loop if we're barking up the wrong tree
while ( !file_exists( $search ) and $limit-- ) $search = '../' . $search;
require_once $search;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment