Wordpress在自己的目录中

时间:2014-09-01 18:21:45

标签: wordpress

我最近安装了来自InMotion的WP 3.9.2。 我正在使用此网址上的说明将wordpress文件放在他们自己的目录中,而不是放在我网站的根目录中:

http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

我之前使用过它,但它确实有效。

这次,这些指令改变了index.php文件:

Change the following and save the file. Change the line that says:

require( dirname( __FILE__ ) . '/wp-blog-header.php' );

to the following, using your directory name for the WordPress core files:

require( dirname( __FILE__ ) . '/wordpress/wp-blog-header.php' );

没有意义,因为“/wp-blog-header.php”文件名没有“require”行。

新index.php文件中唯一需要的行是:

/** Load WordPress Bootstrap */

require_once( dirname( __FILE__ ) . '/admin.php' );

/** Load WordPress dashboard API */

require_once(ABSPATH . '/wp-admin/includes/dashboard.php');

我尝试将指定的wp文件夹添加到这些文件夹中,但没有快乐。

对此有任何建议将不胜感激。

谢谢!

1 个答案:

答案 0 :(得分:1)

我认为你看错了index.php - 你发布的内容适合<root>/wp-admin/index.php,或者<root>/wp-admin/network/index.php

文档中引用的文件是<root>/index.php,其中<root>是当前WordPress安装的最顶层文件夹。

打开它时看起来应该是这样的:

define('WP_USE_THEMES', true);

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

(我已经通过下载新的3.9.2进行了检查)

如果找不到正确的index.php,请尝试通过操作系统的内置搜索功能搜索require('./wp-blog-header.php');

相关问题