roots / sage

WordPress starter theme with Laravel Blade components and templates, Tailwind CSS, and a modern development workflow
https://roots.io/sage/
MIT License
12.77k stars 3.06k forks source link

Sage 9 + Wordpress 6.4 and 6.4.1 create broken Gutenberg layout #3160

Closed JoshuaVB closed 10 months ago

JoshuaVB commented 12 months ago

Version

9.0.9

What did you expect to happen?

Normal gutenberg styles to appear

What actually happens?

Broken gutenberg styles appear

Screenshot 2023-11-29 003126

Steps to reproduce

  1. Have a Sage 9.0.9 theme active with WP Core 6.4 or 6.4.1 present
  2. Go to any page or post and edit it via Gutenberg.

Reverting to WP Core 6.3.2 or lower fixes the issue.

System info

No response

Log output

No response

Please confirm this isn't a support request.

Yes

andrewmarino commented 11 months ago

Ran into the same issue, this fixed it in my case since my Sage 9 themes do not have a theme.json file in them.

/**
 * Satisfy WP check for theme.json without this file being present.
 *
 * @since 6.3
 * @link https://github.com/roots/sage/issues/3143
 */
add_filter('theme_file_path', function ($path, $file) {
    if ($file === 'theme.json') {
        return false;
    }

    return $path;
}, 0, 2);
JoshuaVB commented 11 months ago

@andrewmarino Amazing, thank you so much! Added this to functions.php and it worked like a charm.

josialoos commented 7 months ago

works perfectly thanks so much ❤️️