0
私たちは、それ自身のテーマを持つ私たちのメインのウェブサイト用にインストールされているWordPressがあります。私はここでメインのウェブサイトのテーマを使用したい別のWordPressをサブフォルダにインストールしたいと思っています。2番目のインストールのWordpressの子供のテーマ
index.php
style.css
functions.php
私は新しいインストールindex.phpファイル内のメインウェブサイトのテーマファイル(例えばheader.phpの)を参照しています:
は、だから私は3つのファイルを含む新しいテーマを作りました
<?php
//Checking if file exist
if (file_exists(get_stylesheet_directory() . '/../../../../wp-content/themes/First/header.php')) {
//Require file if it exist,
require_once(get_stylesheet_directory() . '/../../../../wp-content/themes/First/header.php')
} else {
/* Echo something if file doesn't exist, if the message wasn't displayed and you still get 500 error then there's some wrong on the php file above*/
_e('File not found');
}
?>
ただし、これは500エラーを返します。とにかく、このようなことをすることはできますか?フォルダにWordPressの新しいインストールで別のWordPressインストールテーマを使用するには?
は私のfunctions.phpファイルでこの機能を使用する必要がありますか? –