-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detecting pages/posts authored via Gutenberg #2235
Comments
There is a a function mytheme_add_gutenberg_body_class( $body_classes ) {
if ( is_singular() && false !== strpos( get_queried_object()->post_content, '<!-- wp:' ) ) {
$body_classes[] = 'gutenberg';
}
return $body_classes;
}
add_filter( 'body_class', 'mytheme_add_gutenberg_body_class' ); |
That worked perfectly, thank you @westonruter |
That is a very good idea Zulfikar. |
As the solution for a theme has been given, I think for now closing this. I'm not sure the core Gutenberg needs to display a message at this point. |
Is there a way to detect if a page/post is authored via Gutenberg?
Styling older themes when the editor is finally release may prove to be a little bit of a nighmare for some authors. Perhaps a body class of gutenberg could be filtered in?
Right now I've had to create a custom template in order to allow for alignwide/alignfull to take up the full defined width instead of being contrained in the predefined content area width!
`
The text was updated successfully, but these errors were encountered: