我继承了Highgrade以主题构建的网站(southcentral) 它是使用Redux框架构建的。
我在前端和管理面板中看到以下错误:
Warning: Invalid argument supplied for foreach() in /Volumes/Data/Users/me/Sites/reference360.eu/wordpress/wp-content/themes/southcentral/highgrade/framework/inc/fields/typography/field_typography.php on line 772
我试图改变googlefonts的权限和所有权。json,但无济于事。问题似乎在Redux框架内-请参阅this thread 在github上
我正在调试排版。php类:
if (!isset($this->parent->fonts[\'google\']) || empty($this->parent->fonts[\'google\'])) {
$this->parent->fonts[\'google\'] = json_decode($wp_filesystem->get_contents(ReduxFramework::$_dir . \'inc/fields/typography/googlefonts.json\'), true);
var_dump(ReduxFramework::$_dir . \'inc/fields/typography/googlefonts.json\');
var_dump($wp_filesystem->get_contents(ReduxFramework::$_dir . \'inc/fields/typography/googlefonts.json\')); exit;
$this->parent->font_groups[\'google\'] = array(
\'id\' => \'google\',
\'text\' => __(\'Google Webfonts\', \'redux-framework\'),
\'children\' => array(),
);
foreach ($this->parent->fonts[\'google\'] as $font => $extra) {
$this->parent->font_groups[\'google\'][\'children\'][] = array(
\'id\' => $font,
\'text\' => $font
);
}
}
}
有人知道这是什么原因吗?文件存在,并且位于指定的路径。开发环境是OSX Mavericks。UPDATE:
将整个wordpress目录的所有权更改为_www:_www
解决了问题,但显然不是一个很好的解决方案。