Add this to your theme’s functions.php
file:
add_editor_style();
By default that function will load a file called editor-style.css
which is located in the root directory of your theme. The functions accepts a filename or an array of filenames as parameter. Reference in the Codex:
http://codex.wordpress.org/Function_Reference/add_editor_style
If you want (or need to have) more control over the custom CSS file name and location you can use this function instead:
function custom_editor_style($url) {
if ( !empty($url) )
$url .= ',';
// Change the path here if using sub-directory
$url .= trailingslashit( get_stylesheet_directory_uri() ) . 'editor-style.css';
return $url;
}
add_filter('mce_css', 'custom_editor_style');
Related Posts:
- disable WP automatically inserted line breaks after an image
- Remove hidden formatting when user paste text from MS Word into TinyMCE
- Remove permalink from images when inserting into post
- removing inline styles from wp-caption div
- Add custom Attachment Display Setting for images
- How to get Images included in Post
- Find the post an attachment is attached to
- Delete the original big size image after upload and leave only 3 images crunched by media gallery
- Post slugs and images cannot have same name?
- Add existing images from Media Library in to custom gallery
- Replace image attributes for lazyload plugin (data-src)
- How do I detach images from posts?
- Download external images if post is publish
- How do I sort (order) the results from `get_children()`?
- upload image in a meta box
- Can I load posts via Ajax?
- How do I use element instead of tags in WordPress post content having webP support?
- Change padding to text indent in “Increase indent” TinyMCE
- Is there a WordPress equivalent to MediaWiki templates
- How to remove images from showing in a post with the_content()?
- Automatically added brs and paragraphs?
- Unattaching images from a post
- how to display post content without post image?
- How to wrap every image in a post with a div?
- upload featured image from front end using wordpress add media button
- How do I create Comma Separated list of attached image ids?
- Get post embedded image caption
- how to grab first link in post… and of course call it
- Load post content into div with ajax
- Remove whitespace at the end of posts?
- Remove double space after a period
- Add an image box besides featured image?
- Remove image from post also removes photo from media library
- Code Blocks with WYSIWYG in blog post
- Limit function to specific post category
- Post taxonomy from exif data
- Remove inline width from figure
- All my inserted images gets a link to the full image even if it is already full size image
- How to add a custom field after wp post
- get custom image size
- How to get only text from wordpress post content?
- Get all images out of the posts content
- how to replace embedded “full” sized images within a post with the “large” ones
- WordPress Theory Lesson – Image Columns within posts with alignment?
- WordPress’ visual editor messing up my (nested) lists (and other things as well)
- Batch process: remove first image from post content
- how can I put an image in a post with original size
- Show featured image next to post-teasers in Genesis Framework?
- Get image from post’s gallery
- Image Insert into posts and pages not working after 3.2.1 update
- How to retrieve the postID in a “image_send_to_editor” hook function?
- Number format for wp_count_posts()
- Copying and pasting emoji in a wordpress post
- Comma separated all attached image ID numbers except featured image ID number
- Modify Image Source With The_Content Filter?
- How to display featured image without it appearing in post?
- Can I use images as anchor tags with
- Unautop / Sanitize content added to a post through a plugin
- Featured Image uploaded, attached and set but only appearing in the media library
- Load post attached images on a single page site with fancybox
- creating front end image uploader that uploads images as posts
- Errors when uploading images in WP 3.5
- Set size for attachments
- I have a site where attachments in the wp_posts table have guid values of guid, how did this happen?
- CSS: How can I show a photo beyond the template’s column, but contained within the browser window? [closed]
- Get all attachment by post excluding featured and content inside
- wp-cli post create & media import issues
- Get attachments for posts that belongs to a specific category
- List all categories with featured image from post?
- Apostrophe in a possessive appears as an open-single-smart-quote instead of a closed one
- Posting blog entries in screenplay format
- Get all images in post and comments like Twitter before post title
- Show only posts with images and a fixed amount of posts
- Issue where WP Featured Image will not display
- How would one change the default url structure of attachments?
- If statement to check if post has image
- Gather posts into a cart/lightbox and share with another user
- Thumbnail Image to go in the post aswell
- Remove Featured Image & All Media Uploaded to the Post
- What are the benefits of setting a “featured image” for a WP blog post?
- How to get post body look same as my visual editor?
- preg_replace not removed “class”
- update image path with words starting uppercase to lowercase chars
- How to only publish posts with image in it
- Can’t give tags rels
- Uploading images in custom post form
- Upload attachment from external site
- Make insterted image point to post url instead of attachment page
- Get URL from all images in a post
- Disable posts generated from image uploads
- how to give multiple post thumbnails to a post
- Posts page not showing correct image
- Images showing up in Post Editor, but not in Published Post
- How to allow multiple thumbnail upload for Posts?
- Image behind the post’s title
- get_children returns older images
- How to display post title inside thumbnail?
- How to remove text and retain in caption image using the_content function
- How to retrieve certain number of images from a wordpress post?
- Can’t update WordPress Page if post_content is Empty