• Resolved meischtero

    (@meischtero)


    Hello,

    I have switched off local hosting of fonts in Twentig and after some changes in the Twenty Twenty Two theme settings I have switched it back on and have received the following fatal error as a result when trying to load the website:

    Uncaught TypeError: Cannot access offset of type string on string in /home/example/public_html/wp-content/plugins/twentig/inc/wptt-webfont-loader.php:321 Stack trace: #0 /home/example/public_html/wp-content/plugins/twentig/inc/wptt-webfont-loader.php(193): WPTT_WebFont_Loader->get_local_files_from_css() #1 /home/example/public_html/wp-content/plugins/twentig/inc/wptt-webfont-loader.php(677): WPTT_WebFont_Loader->get_styles() #2 /home/example/public_html/wp-content/plugins/twentig/inc/block-themes.php(123): wptt_get_webfont_styles(‘https://fonts.g…’) #3 /home/example/public_html/wp-includes/class-wp-hook.php(308): twentig_block_theme_enqueue_scripts(”) #4 /home/example/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #5 /home/example/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #6 /home/example/public_html/wp-includes/script-loader.php(2194): do_action(‘wp_enqueue_scri…’) #7 /home/example/public_html/wp-includes/class-wp-hook.php(308): wp_enqueue_scripts(”) #8 /home/example/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #9 /home/example/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #10 /home/example/public_html/wp-includes/general-template.php(3049): do_action(‘wp_head’) #11 /home/example/public_html/wp-includes/template-canvas.php(17): wp_head() #12 /home/example/public_html/wp-includes/template-loader.php(106): include(‘/home/example/…’) #13 /home/example/public_html/wp-blog-header.php(19): require_once(‘/home/example/…’) #14 /home/example/public_html/index.php(17): require(‘/home/example/…’) #15 {main} thrown in /home/example/public_html/wp-content/plugins/twentig/inc/wptt-webfont-loader.php on line 321

    The local hosting works for other themes and the website works fine without the option switched on, but together the error occurs and re-installing Twentig has not solved it. Have you come across the issue before or have any idea how to solve it? Thank you!

Viewing 1 replies (of 1 total)
  • Plugin Support Yann

    (@collet)

    Hello,

    We’ve never encountered this issue before, so I’m uncertain about its cause. The file that seems to be causing the problem, ‘wptt-webfont-loader.php,’ is a PHP class created by the WordPress Themes Team (https://github.com/WPTT/webfont-loader). This class allows to download Google Fonts and host them locally on a WordPress site.

    To rule out a plugin conflict, could you please try to deactivate all other plugins except for Twentig? If the error disappears, start reactivating your plugins one by one until you pinpoint the one causing the issue.

    If that doesn’t resolve the issue, another step you could try is to delete all the font files located in your WordPress installation under the ‘wp-content/fonts’ folder. This action will force the system to regenerate the font files.

    Could you please tell me which fonts you were trying to set so I can test if the issue is not with them?

    Thank you,
    Yann

Viewing 1 replies (of 1 total)
  • The topic ‘Host Google Fonts locally – Fatal Error’ is closed to new replies.