我面臨錯誤/警告非法字符串偏移量Wordpress中的非法字符串偏移量警告
我檢查了我的所有代碼,但沒有找到錯誤原因。 具有以下功能我的主題風格正在運行代碼是在word.php中的單詞按主題編寫的。 (!)
尖叫:錯誤抑制忽略 警告(!):非法串F中偏移 '面子':\ WAMP \ WWW \ WordPress的-3.6.1-newsduke \可溼性粉劑內容\主題\ hotnews \在線功能\主題的functions.php 140
function freshthemes_theme_styles() {
/* Google fonts array */
$google_fonts = array_keys(freshthemes_typography_get_google_fonts());
/* Define all the options that possibly have a unique Google font */
$body_font = ft_get_option('body_font', 'Arial, Helvetica, san-serif');
$heading_font = ft_get_option('heading_font', 'Arial, Helvetica, san-serif');
$menu_nav_font = ft_get_option('menu_nav_font', 'Arial, Helvetica, san-serif');
/* Get the font face for each option and put it in an array */
$selected_fonts = array(
$body_font['face'],
$heading_font['face'],
$menu_nav_font['face'],
);
/* Remove any duplicates in the list */
$selected_fonts = array_unique($selected_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, $google_fonts)) {
freshthemes_typography_enqueue_google_font($font);
}
}
// Register our styles.
wp_register_style('main', get_stylesheet_uri(), false, THEME_VERSION, 'all');
wp_register_style('prettyPhoto', THEME_DIR . '/stylesheets/prettyPhoto.css', false, THEME_VERSION, 'all');
wp_register_style('responsive', THEME_DIR . '/stylesheets/responsive.css', false, THEME_VERSION, 'all');
wp_register_style('custom-style', THEME_DIR . '/functions/framework/frontend/custom-style.css', false, filemtime(THEME_PATH . '/functions/framework/frontend/custom-style.css'), 'all');
// Enqueue them.
wp_enqueue_style('main');
wp_enqueue_style('custom-style');
wp_enqueue_style('prettyPhoto');
wp_enqueue_style('responsive');
}
我覺得很難相信'互聯網和搜索engines'沒有爲'警告列出任何內容:非法串offset' ? – AlexP
對不起,但沒有找到有用的答案 –
var_dump($ body_font,$ heading_font,$ menu_nav_font)顯示什麼? – anupam