I’ve inherited a site built with a theme by Highgrade (southcentral) which is built using the Redux framework.
I’m seeing the following error in the frontend and admin panel:
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
I’ve tried altering permissions and ownership on googlefonts.json but to no avail.
The problem seems to be within the Redux framework – see this thread on github
I’m debugging in the typography.php class :
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
);
}
}
}
Anyone got any idea what might be causing this? The file exists and is at the path specified. Development environment is OSX Mavericks.
UPDATE:
changing the ownership of the entire wordpress directory to _www:_www
resolves the problem but is obviously not a great solution.