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
- Add custom Attachment Display Setting for images
- 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?
- Is there a WordPress equivalent to MediaWiki templates
- How to wrap every image in a post with a div?
- upload featured image from front end using wordpress add media button
- Get post embedded image caption
- how to grab first link in post… and of course call it
- Remove double space after a period
- Limit function to specific post category
- Post taxonomy from exif data
- get custom image size
- How to get only text from wordpress post 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
- 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()
- How to display featured image without it appearing in post?
- Can I use images as anchor tags with
- creating front end image uploader that uploads images as posts
- 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]
- List all categories with featured image from post?
- Show only posts with images and a fixed amount of posts
- 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
- 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?
- 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
- Make insterted image point to post url instead of attachment page
- how to give multiple post thumbnails to a post
- Posts page not showing correct image
- How to allow multiple thumbnail upload for Posts?
- 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
- Can’t update WordPress Page if post_content is Empty
- How to get all inline images in post content? [duplicate]
- How to Featured content with images in home page?
- How to show a featured image inside a post in only 1 single category
- Inserting Media to WordPress Posts
- Author Avatar as default first image
- Link post images to post
- How to get the next and previous image title from attachment or gallery?
- Only show featured image on exerpt and exclude images in post
- WordPress as CMS: How to manage/handle images assigned to a post as full-sized background images in a slideshow?
- How to determine if a post was last edited in the Visual Editor
- how can display a post on home screen without images
- Keyboard shortcut for headings on safari
- Changing The Default Header POST Title and Description text by category in wordpress
- How to exclude native lazy loading from first image in post content?
- Rewrite image links from attachment id to attachment link
- Aligning images in the wp editor not working. How do i get this to work in custom theme?
- unable to write to the database while uploading images
- How can I change the date format of the revision list?
- Pinterest button shows image options from different posts
- Change the size of the featured image for post?
- Modified core/image rendering not showing in posts – only on pages
- Post images are not displayed in media library
- Delete attached images from posts
- Blog images not showing on homepage
- Schedule image post on download
- Integrate video and iframe in a post type gallery
- Set featured image on creating new post
- how to create other sizes of original image in one go wordpress uploads
- Stop images from being displayed on the front-end of the site
- Relative Image Urls in Posts are starting from root – Not from WordPress Address (URL) at General Settings
- WordPress Media URLs?
- Featured Images link to post parent
- When I click edit on a post, all the content disappear. Does anyone know how to fix this?
- How do I insert a custom field in a user submitted post?
- Assign custom class to post content images
- Post thumbnail height problem
- Get attachment if matches a variable
- Show Title/Date/Excerpt of first post & only Title for rest in Query [duplicate]
- Displaying all images from a WordPress post (including media library)
- How to move all images in a post to a single gallery for a bunch of posts?
- website images getting corrupt automatically
- Optimize blog that serves hundred of images and videos