dongye1912 2013-09-23 10:51
浏览 64
已采纳

Wordpress中的非法字符串偏移警告

I am facing error/Warning Illegal string offset

I have check all my code but no error reason found. with below function my theme style is working the code is written in word press theme in the function.php.

( ! ) SCREAM: Error suppression ignored for ( ! ) Warning: Illegal string offset 'face' in F:\wamp\www\wordpress-3.6.1-newsduke\wp-content\themes\hotnews\functions\theme-functions.php on line 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');
    }
  • 写回答

2条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 keil MDK软件进行仿真调试的局限
      • ¥15 关于gateway产生临时文件夹的问题
      • ¥15 Java Broken Pipe以及OOM
      • ¥20 请问有没有RTL8211FS的参考原理图
      • ¥30 esp32的platfromio工程添加文件就会编译失败
      • ¥15 linux下运行VASP报错
      • ¥15 python里面查找赋值,如何可以在剩余未空值的行里面进行进一步的筛选呢?
      • ¥15 电路分析的综合实验有没有会的
      • ¥15 #硬件设计#PNP三级管输出设计问题
      • ¥30 ORACLE的procedure突然需要重新编译是为什么?