Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/19.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
Php 标题下方所有页面上的Wordpress错误(使用主题)_Php_Wordpress_Google Fonts - Fatal编程技术网

Php 标题下方所有页面上的Wordpress错误(使用主题)

Php 标题下方所有页面上的Wordpress错误(使用主题),php,wordpress,google-fonts,Php,Wordpress,Google Fonts,错误出现在以下地址文件的下面几行(第186行和第187行): 网站(直播): 尝试恢复较早的备份(24小时前),但也不起作用 源行的第186行和第187行: $collections = get_option('google_typography_collections'); $google_fonts_all = $this->get_fonts(); $import_fonts = array(); if ($collections) { foreach ($collectio

错误出现在以下地址文件的下面几行(第186行和第187行):

网站(直播):

尝试恢复较早的备份(24小时前),但也不起作用

源行的第186行和第187行:

$collections = get_option('google_typography_collections');
$google_fonts_all = $this->get_fonts();
$import_fonts = array();
if ($collections) {
    foreach ($collections as $collection) {
        $font_family = $collection['font_family'];
        $font_index = array_search($font_family,
                              array_column($google_fonts_all,'family'));//Line 186
        $font_variants = implode(',', $google_fonts_all[$font_index ['variants']); //Line 187
                array_push(
                    $import_fonts,
                    array(
                        'font_family' => $collection['font_family'],
                        'font_variant' => $font_variants,

错误消息(在网站的所有页面上,这些只是其中的几行内容):


您之所以会收到这些错误,是因为在第186行,$google_fonts_all不包含带有“family”键的数组,或者它不是数组。在这两种情况下,表达式array\u column($google\u font\u all,'family')返回空

可以将后面的表达式提取到变量中: $family=array_列((数组)$google_fonts_all,'family')

在第187行,检查条件语句或itenary中的isset($google\u font\u all[$font\u index]['variants'])

问候 Eliasu

智慧实验室发布了一个解决问题的方法

content/themes/elumine/includes/integrations/google-typography/google-typography.php on line 186

Warning: array_search() expects parameter 2 to be array, null given in /home/customer/www/healthyminds.world/public_html/wp-content/themes/elumine/includes/integrations/google-typography/google-typography.php on line 186

Warning: Illegal string offset 'variants' in /home/customer/www/healthyminds.world/public_html/wp-content/themes/elumine/includes/integrations/google-typography/google-typography.php on line 187

Warning: implode(): Invalid arguments passed in /home/customer/www/healthyminds.world/public_html/wp-content/themes/elumine/includes/integrations/google-typography/google-typography.php on line 187