The correct way to enqueue an editor stylesheet is as follows:
add_action( 'after_setup_theme', 'generate_child_setup' );
function generate_child_setup()
{
add_editor_style( 'path/to/editor-style.css' );
}
I pulled that snippet from here:
https://generatepress.com/forums/topic/how-to-call-editor-style-css-from-child-theme/#post-149083
I guess the intuitive approach for most would be to enqueue it in the admin but that wouldn’t apply it correctly. I believe add_editor_style()
ensures it’s added to the actual content editor.
Here’s the WordPress Codex page for it: https://developer.wordpress.org/reference/functions/add_editor_style/
Related Posts:
- How can I put a custom meta box above the editor but below the title section on the edit post page?
- Add custom fields within meta box class “on the fly”
- Disable the visibility options in WP
- How to replace default icon on “Add Media” button?
- Why could I not change the icon of the default Add media button that I added into the toolbar of TinyMCE?
- can’t see all pages in dashboard (can only see 3) /wp-admin/edit.php > 500 error
- WordPress Post Editor Toolbar Missing
- How to add “Check all” to Edit post page in WP?
- How do I disable wpautop for a specific block?
- Is it possible to “comment out” text in a post?
- Make substitute in all WordPress posts
- Show box only on edit post
- Adding a tooltip above Categories postbox in Post Editor
- YouTube Video autoplay
- How can I define a max width for content in post editor based on a page template?
- wp_update_post() blank screen
- Post editor loads empty
- Word count not accurate – potential bug
- Prepare content from a different CMS/WYSIWYG to the WordPress editor
- Admin sidebar overlapping on editor when saving draft
- How can I remove the editor from the ‘main posts page’?
- Theme post editor does not have Visual & Html tabs and all buttons?
- Confirmation message when submitting post for review
- How can I add a stylesheet to the Classic Editor page?
- < ! - - more - - > tag not working
- How can I (for the long term) style the classic editor’s TEXTAREA?
- how can i add extra parameter to edit post link?
- Empty paragraphs around figure and figcaption tags when using markdown
- How can I implement a simple post editor?
- How to retain last modification date on draft edit
- Remove inline linking tool
- No CSS being loaded on backend
- Unable to select an old date in wordpress
- Force category choice before creating new post?
- Syntax highlighting for post/page editor [closed]
- wordpress wp-admin css not loading
- add button to post edit page when post_status=publish
- Adjust the Device Preview sizes used in the WP 4.5 Customizer
- How do i use fontawesome icons in TinyMce editor?
- How do I position meta_box on post edit screen after the title?
- Tabindex on text input immediately after WordPress title input
- Prevent WordPress from abbreviating-long-slugs…-in-the-admin
- How to make a script load after Custom Block is loaded in the editor?
- Add visit site to your toolbar instead of being in the dropdown
- Post/Page Publish/Update button not clickable once I make an edit
- WordPress 4.6 link edit dialog is too rudimentary
- Add comments from the admin panel?
- How to add custom css to login and admin?
- How to add editor’s name to entry meta byline?
- How to group meta boxes on the post edit page
- How to enable the tag in WordPress posts and pages
- wp_editor on front end – JavaScripts not included
- How to add button to post page WordPress 5.x
- Edit the “Post updated. View post” link
- How to hide menu on WordPress admin
- How to show an error message after publishing a post?
- No Edit / Delete Links for Custom Post Type?
- How to Load Scripts and CSS for Admins Only When Editing or Adding Posts
- Remove “From computer” media tab for posts with existing attachments?
- What are the better WYSIWYG post editor replacement alternatives?
- How can I hook into the post editor title field in order to change the HTML?
- Add search to list of categories in post editor
- Restrict acceess of a page in backend
- Publish post when edit post form submitted with enter/return pressed on keyboard
- WordPress MultiSite Paste from Word Tool Does not work
- Automatically set page order on create page
- Why is the new Gutenberg editor so narrow, and how to make it wider?
- What is the action or filter for changing permalink in Edit Post/Page?
- Adding a Nav menu to post admin
- How to display and use all existing tags at my write-post-at-frontend-panel?
- TinyMCE Autoresize
- onClick inside post_content does not appear in post tinymce editor
- How-to stop wordpress from saving utf8 non-breaking space characters
- Simple/basic use of get_current_screen
- Custom edit post column – category not showing
- Is it possible to be more page/post specific with admin_enqueue_script?
- How to after saving or publishing a post redirect back to the original page
- How to wrap the content of the main tinyMCE editor with extra tags
- What exact CSS minifier does WP core use?
- Gutenberg Block Editor Match Admin Styles & Frontend Styles
- What is better way to use Bootstrap inside admin panel?
- Hide Front-End Admin Bar Including 32 px Spacing
- Create and edit posts from front end
- Changing Gutenberg / WP block editor width only on pages, not posts or other taxonomies
- Deregister CSS style link ‘open-sans-css’
- tinyMCE duplicates previous block element when pressing return (visual editor)
- Consolidate Metaboxes into 1 Big Metabox
- Should the WP post editor B (bold) button be inserting a tag instead of in HTML5?
- 2nd button row from WP Super Edit or TinyMCE Advanced doesn’t show to 2nd admin
- Using WPAlchemy metabox values in another metabox
- How to add background image control to page admin controls?
- Hide content editor for posts after approriate date
- How to add multiple checkbox elements to media attachments?
- How can I make the Uploaded field editable for Media Library?
- Added custom styles to Visual Editor. Classes are appended and not replaced as intended
- Editing a Post, 99% CPU?
- How to get value of selected page template in Gutenberg editor?
- WordPress hook that gets featured image from direct URL?
- Hide tag and category boxes from the post editor
- How can I automatically set a post slug based on the post title during post publish?