LoginSignup
1
1

More than 5 years have passed since last update.

wp-config.phpでURLやwp-configの場所を定義する

Last updated at Posted at 2015-12-01

ディレクトリ構成

index.php
wp (gitのsubmoduleとしてWordPressをインストールする)
wp-content (wp/wp-contentの内容を複製して外に置く)
wp-config.php

wp-config.php, index.php

wp-config.php
$URL = 'http://YOUR_DOMAIN';

# WordPress Address
define('WP_SITEURL', $URL.'/wp/');

# Site Address
define('WP_HOME', $URL.'/');

# wp-content Directory
define('WP_CONTENT_DIR', dirname(__FILE__).'/wp-content');

# wp-content Address
define('WP_CONTENT_URL', $URL.'/wp-content');

index.php
<?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);

/** Loads the WordPress Environment and Template */
require('./wp/wp-blog-header.php');
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1