Skip to content

Instantly share code, notes, and snippets.

@ambercouch
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 ambercouch/dc73d27a41f2eaf31943 to your computer and use it in GitHub Desktop.
Save ambercouch/dc73d27a41f2eaf31943 to your computer and use it in GitHub Desktop.
Wordpress as a sub-module
##Put our core files and folders in the cms folder
##Put our content files and folders in the content folder
|--my_wp_folder
| |--index.php
| |--wp-config.php
| |--wp-wapper-config.php
| |--cms
| | |--wp-admin
| | |--wp-includes
| |--content
| | |--themes
| | |--plugins
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
/** This now points to our wordpress folder in this instancs the WP core files are in the cms folder */
/** Loads the WordPress Environment and Template */
require('./cms/wp-blog-header.php');
<?php
/** Include this in your wp-config file before the last require statement */
/**
* Set custom paths
*
* These are required because wordpress is installed in a subdirectory.
* In this example WP core files are in the csm folder.
* The wp-content files are in the content folder.
*/
if (!defined('WP_SITEURL')) {
define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . '/cms');
}
if (!defined('WP_HOME')) {
define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME'] . '');
}
if (!defined('WP_CONTENT_DIR')) {
define('WP_CONTENT_DIR', dirname(__FILE__) . '/content');
}
if (!defined('WP_CONTENT_URL')) {
define('WP_CONTENT_URL', 'http://' . $_SERVER['SERVER_NAME'] . '/content');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment