Fix broken full bleed template in post editor
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-07-30 16:20:27 +05:00
parent 4e9c38d695
commit 8be2b61615
4 changed files with 25 additions and 7 deletions

1
.gitignore vendored
View File

@ -1 +0,0 @@
.todo

6
.todo
View File

@ -1,5 +1,5 @@
Change default font size to 18px
Change default font size for paragraph block
Change default font size to 18px @done(25-07-30 16:05)
Change default font size for paragraph block @done(25-07-30 16:05)
✔ Change default font size on front page @done(25-07-30 15:48)
✔ Change default text on about page font size @done(25-07-30 15:52)
✔ Change font size on services page @done(25-07-30 15:59)
@ -7,7 +7,7 @@
✔ Change font size on blog page @done(25-07-30 15:59)
✔ Sync all content changes to live @done(25-07-30 16:04)
Fix broken full-bleed template in post editor
Fix broken full-bleed template in post editor @done(25-07-30 16:20)
☐ Change services page to use tabs

View File

@ -81,7 +81,12 @@ ul.is-style-arrow-list {
}
/* HACK: fixing stretched out post width in editor */
.edit-post-visual-editor .editor-styles-wrapper .block-editor-block-list__layout.is-root-container > :where(:not(.alignleft):not(.alignright):not(.alignfull)),
:where(:not(.template-full-bleed)) .edit-post-visual-editor .editor-styles-wrapper .block-editor-block-list__layout.is-root-container > :where(:not(.alignleft):not(.alignright):not(.alignfull)),
.edit-post-visual-editor .editor-styles-wrapper .editor-editor-canvas__post-title-wrapper > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
max-width: 600px !important;
}
body.template-full-bleed :where(:not(.template-full-bleed)) .edit-post-visual-editor .editor-styles-wrapper .block-editor-block-list__layout.is-root-container > :where(:not(.alignleft):not(.alignright):not(.alignfull)),
body.template-full-bleed .edit-post-visual-editor .editor-styles-wrapper .editor-editor-canvas__post-title-wrapper > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
max-width: unset !important;
}

View File

@ -77,3 +77,17 @@ remove_filter('get_the_excerpt', 'wp_trim_excerpt');
// add custom filter
add_filter('get_the_excerpt', 'so306588_trim_excerpt_custom');
/*
* Add template class to admin body based on current page's template.
*/
function mytheme_add_template_class($classes)
{
$template = get_page_template_slug();
if ($template) {
$class = preg_replace('/\.php$/', '', $template);
$classes .= ' template-' . sanitize_html_class($class);
}
return $classes;
}
add_filter('admin_body_class', 'mytheme_add_template_class');