Auto LTR-RTL Text Direction in wordpress post!
Auto LTR-RTL Text Direction in wordpress post!
Auto LTR-RTL Text Direction in wordpress post!
I’ve now realized the code I posted works. I expected to see the stylesheet referenced in the head, but there is no such reference. It turns out the styles are being applied solely on the basis of the settings in tinyMCEPreInit. In fact, this is all that’s needed: add_editor_style(‘editor-style.css’);
SHORT VERSION Using css it’s possible to use of the :not() selector to exclude Tinymce instances, e.g. body:not(.mce-content-body) {…} LONG VERSION Let’s assume we have declared theme support for editor styles and included an editor stylesheet somewhere in our theme (e.g functions.php) like this: add_theme_support( ‘editor-styles’ ); add_editor_style( ‘something/something/css/editor.css’ ); For the sake of this … Read more
add_editor_style( $stylesheet ); http://codex.wordpress.org/Function_Reference/add_editor_style
This kind of problems are solved using Chrome Inspector or Firefox Firebug. Inspecting the element, we get the necessary ID’s or Classes to add in the stylesheet. So, .mceContentBody.wp-fullscreen-editor is the one we need to address in the theme file editor-style.css: .mceContentBody.wp-editor, .mceContentBody.wp-fullscreen-editor { background-color: #000; color: #fff; }
The simplest answer is: you can use whatever stylesheet you want for the editor. editor-style.css is just the default stylesheet loaded if none is passed to add_editor_style(). This will load the specified stylesheet: add_editor_style( ‘some-stylsheet.css’ ); This will load editor-style.css: add_editor_style(); Use whatever better fits your needs. By the way, it is better practice to … Read more
This isn’t quite the solution I was looking for, but I realized that by making the tags more specific in the block stylesheets, I was able to prevent most issues from happening. By adding a div tag to the front of the tmp-container-fixed class, I was able to get the blocks to render properly in … Read more
You shouldn’t call add_editor_style() directly in your functions.php file. Instead, you should wait until the plugins and themes have been loaded: add_action( ‘after_setup_theme’, ‘add_editor_style’ ); If you already have a function hooked to after_setup_theme, you can call add_editor_style() inside there instead. You then need create a file called editor-style.css and place it in your theme … Read more
While @s_ha_dum’s solution works fine on a custom plugin page, it will fail if you use TinyMCE on a post editor page after the first editor instance has been called, because it would either affect all editors or at least the editors later on the same page. TinyMCE parses custom styles into its settings during … Read more
Use add_editor_style e.g.: functions.php add_editor_style(‘custom-editor-style.css’); http://codex.wordpress.org/Function_Reference/add_editor_style