2015-08-18 44 views
0

這是我一起工作的代碼 -警告:非法串在WordPress的偏移「面子」黑火

if (!function_exists('blackfyre_options_typography_google_fonts')) { 
    function blackfyre_options_typography_google_fonts() { 
     $all_google_fonts = array_keys(blackfyre_options_typography_get_google_fonts()); 
     // Define all the options that possibly have a unique Google font 
     $google_font = of_get_option('google_font', 'Rokkitt, serif'); 
     $google_mixed = of_get_option('google_mixed', false); 
     $google_mixed_2 = of_get_option('google_mixed_2', 'Arvo, serif'); 
     // Get the font face for each option and put it in an array 
     $selected_fonts = array(
      $google_font['face'], - 1035 line 
      $google_mixed['face'], 
      $google_mixed_2['face']); - 1037 line 
     // Remove any duplicates in the list 
     $selected_fonts = array_unique($selected_fonts); 
     // Check each of the unique fonts against the defined Google fonts 
     // If it is a Google font, go ahead and call the function to enqueue it 
     foreach ($selected_fonts as $font) { 
      if (in_array($font, $all_google_fonts)) { 
       blackfyre_options_typography_enqueue_google_font($font); 
      } 
     } 
    } 
} 

這是我收到的錯誤訊息 -

警告:非法串偏移'face'in /home/imposing/public_html/wp-content/themes/blackfyre/functions.php on line 1035

警告:/ home/imposing/public_html/wp-content/themes中的非法字符串偏移'face' /blackfyre/functions.php在線1037

我需要幫助來解決此錯誤和/或指向正確的方向。

回答

0

我有同樣的問題,就像我在之前的評論說通過我,通過改變在加時賽中的functions.php,線路105碼固定它 - 107到:

$selected_fonts = array(
$google_font, 
$google_mixed, 
$google_mixed_2); 

Illegal string offset Warning in Wordpress發現

我希望能爲你解決。

乾杯。

相關問題