Check if current page is using blocks (Gutenberg) or is legacy
Is there a way to know if a page is using Gutenberg or not?
The use case is migrating an old post to Gutenberg and letting crafted pages just render themselves with blocks but add some wrapping around old pages which probably won't be migrated since they're just text (Privacy policy and those). They need to coexist at least for a while.
A block editor page can usually be just rendered with
?php
get_header();
while (have_posts()) :
the_post();
the_content();
endwhile;
get_footer();
While I have that handled for the homepage using a p front-page.php
template, I'd like to have a generic template that can handle both types so I don't have to go slug by slug.
Topic block-editor Wordpress
Category Web