Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何包含wordpress主题目录上方目录中的部分?_Wordpress_Themes_Wordpress Theming_Directory Structure - Fatal编程技术网

如何包含wordpress主题目录上方目录中的部分?

如何包含wordpress主题目录上方目录中的部分?,wordpress,themes,wordpress-theming,directory-structure,Wordpress,Themes,Wordpress Theming,Directory Structure,我现在已经设置了3个主题,我需要它们都从同一个源继承部分,以便在我更改任何部分时,在同一时间更新所有三个主题 我看到了 include("../../../includes/vital/partial.php"); 无法在single.php或任何其他主题模板文件中工作。我得到的错误是: 警告:include():在/Users/insertusername/Documents/Code/Projects/wordpress/wordpress-1/wp content/themes/flow

我现在已经设置了3个主题,我需要它们都从同一个源继承部分,以便在我更改任何部分时,在同一时间更新所有三个主题

我看到了

include("../../../includes/vital/partial.php");
无法在single.php或任何其他主题模板文件中工作。我得到的错误是:

警告:include():在/Users/insertusername/Documents/Code/Projects/wordpress/wordpress-1/wp content/themes/flowerz mobile/single.php第7行的/Users/insertusername/Documents/Code/Projects/wordpress/wordpress-1/wp content/themes/flowerz mobile/single.php中打开“../include():include(../include//vital/vital/partial.php

我怎样才能做到这一点


谢谢

由于Wordpress基于主
index.php
加载所有内容,因此下面的代码在每个主题中都适用于我

include("includes/vital/partial.php");

没错,一开始没有任何
。/

零件在哪里?什么文件夹?它位于wordpress_root/includes/vital/Thank you!我试图使用某种绝对路径API函数,比如get_bloginfo('wpurl')…等等。