-
Anonymous
Hey there,
I know this isn’t a GP issue, but a core WP one.
In the admin edit screen, when you are editing a post, I want to hide the content area. I’m using Publish Press and have it where all of the blocks are inaccessible, but it leaves a giant white area between the title and the editing meta boxes. I think it would have to be a snippet. Any idea how to simply hide the entire content box, like where you would add blocks below the title?Thanks in advance for any help!
-
Anonymous
I tried this but it did unwanted things. Deactivated the snippet.
add_filter(‘use_block_editor_for_post_type’, ‘prefix_disable_gutenberg’, 10, 2);
function prefix_disable_gutenberg($current_status, $post_type)
{
// Use your post type key instead of ‘product’
if ($post_type === ‘product’) return false;
return $current_status;
}
It added back in admin only ACF fields and a Wsywig text box – don’t want those. I just want to close the giant gap after the title and before the metaboxes.In the private box is a log in and link to see where I’m talking about.
Thanks so much if you can help!
-
Anonymous
I also tried this
add_filter(‘use_block_editor_for_post_type’, ‘prefix_disable_gutenberg’, 10, 2);
function prefix_disable_gutenberg($current_status, $post_type)
{
// Use your post type key instead of ‘product’
if ($post_type === ‘product’) return false;
return $current_status;
}It added back in admin only ACF fields and a Wsywig text box – don’t want those. I just want to close the giant gap after the title and before the metaboxes. It also added all of the side bars back in. I’m trying to give guest editors a clean meta box only editing screen.
-
Anonymous
Also, is there any way to have default content in that area, per post type? Like an Element but it would show up where the content block editor area is?
-
Anonymous
Another clarification/question:
What I’m trying to accomplish is that when a customer is editing their post:
1. There isn’t a huge gap between the title and the meta boxes. They aren’t adding any content to the block editor area; all blocks are turned off for them via Publish Press. They are just adding details to ACF fields in the meta boxes below the content editor. It just looks terrible with a giant gap of nothing between the title and the boxes they will be editing.
2. It’s only when they are editing, not for the front end, but I’d love to be able to add an element after the title and before the meta boxes with instructions, an email contact if they need support, etc. I’ve been playing with Block element > Element type content and Hooks, but I can’t get there. I would only want that to shop up when they are logged in and editing, not on the front end. I can set the visibility of a block to be the author, but it would still show up on the front end for them which I don’t want.The goal is to have it be a nice clean editing experience for a customer. I’ve got almost all of the elements hidden I don’t want them to have access to but am down to this last niggly bit of the giant white space.
Thought that clarification might be useful.
Also, I can’t seem to hide the editor-document-bar at the top of the edit screen, in the middle at the top with the title of the post and Command K. I tried display none for editor-document-bar and editor-header_toolbar but no dice. Do you know of any way to hide that bar in the editing environment?
Thanks so much as always in advance.
-
Alvind
Hi there,
Regarding the gap between the title and the meta boxes, try adding this snippet to address the issue:
function add_block_editor_styles() { $css = ' :root :where(.editor-styles-wrapper)::after { height: unset !important; }'; wp_add_inline_style('wp-block-editor', $css); } add_action('enqueue_block_editor_assets', 'add_block_editor_styles');
- You must be logged in to reply to this topic.