Array value ‘content_css’ is not enough, TinyMCE can’t simply get the classes from the custom.css file. You need to define the list of styles you want in the dropdown:
function my_format_TinyMCE( $in ) {
$in['content_css'] = get_template_directory_uri() . "/custom.css";
$in['importcss_append'] = TRUE;
$in['style_formats'] = json_encode(array(
array('title' => 'Title for Style #1', 'classes' => 'example-class'),
array('title' => 'Title for Style #2', 'classes' => 'example-class-two'),
));
return $in;
}
add_filter( 'tiny_mce_before_init', 'my_format_TinyMCE' );
For the full format of what can be included in the ‘style_formats’, check out TinyMCE documentation: Style Formats in TinyMCE. Make sure it has to be in JSON format (that is why I used the json_encode function.
Related Posts:
- Forcing reload of editor-style.css
- How can I insert HTML attributes with an existing TinyMCE button?
- TinyMCE: adding CSS to format dropdown
- How do i use fontawesome icons in TinyMce editor?
- How to add a class to ul tags created by the WordPress editor Tinymce?
- How to make float element in tinymce
- WordPress stripping out BR tags, need assistance
- Different css rules for TinyMCE and Gutenberg while using add_editor_style()
- Inline Style attribute getting stripped off
- Custom styles dropdown in TinyMCE editor – not working with headings
- jQuery UI styles conflicting with TinyMCE dialog
- How to sync the style in the visual editor with the style of a child theme?
- How do I get access to the CSS Editor
- How to style text in WordPress
- How to add class to an html output element in tinyMCE paragraph drop down menu
- Customizing the Post/Page Editor in Classic Editor
- How can I add a stylesheet to the Classic Editor page?
- TinyMCE on frontend style not working
- How to adjust text’s width and put it at center of post (Visual) editor?
- Add WordPress Core CSS into editor-style.css
- How do I change TinyMCE button “i” to create a i tag rather than em? [duplicate]
- Bullet List Indentation not showing up in the wordpress
- Enqueue MCE Editor CSS in admin page
- Why is TinyMCE 4.x not using updated CSS even with forced reload? [closed]
- Why does the “visual editor” add useless html-comments and how can I get rid of them?
- What’s the difference between SCSS and Sass?
- How am I supposed to use index.html?
- Column order manipulation using col-lg-push and col-lg-pull in Twitter Bootstrap 3
- What is the difference among col-lg-*, col-md-* and col-sm-* in Bootstrap?
- Adding border to SVG image
- What does !important mean in CSS?
- Set line spacing
- Remove blue underline from link
- CSS Background Opacity [duplicate]
- Outline effect to text
- Customize Bootstrap checkboxes
- Making a
- React.js inline style best practices [closed]
- What is a user agent stylesheet?
- What is a user agent stylesheet?
- Is there a CSS parent selector?
- CSS to make HTML page footer stay at bottom of the page with a minimum height, but not overlap the page
- Vertically align text within a div
- How to align a to the middle (horizontally/width) of the page [duplicate]
- Animate the overflow property
- Is there a color code for transparent in HTML?
- multiple classes on single element html
- CSS opacity only to background color, not the text on it?
- How do I center floated elements?
- create a white rgba / CSS3
- Using CSS for a fade-in effect on page load
- Gradient borders
- Superscript in CSS only?
- What is WebKit and how is it related to CSS?
- What’s the difference between display:inline-flex and display:flex?
- Making an iframe responsive
- How can I invert color using CSS?
- How to insert spaces/tabs in text using HTML/CSS
- font-family is inherit. How to find out the font-family in chrome developer pane?
- How to get these two divs side-by-side?
- How can I vertically center a “div” element for all browsers using CSS?
- What does auto do in margin: 0 auto?
- Does bootstrap have builtin padding and margin classes?
- How to change the color of an svg element?
- Changing spacing between paragraphs and inside of paragraphs
- Is there a color code for transparent in HTML?
- How to vertically align an image inside a div
- How can I center an absolutely positioned element in a div?
- Nesting CSS classes
- Applying Comic Sans Ms font style
- How to set up fixed width for
? - “Stray start tag footer” in html validator?
- How to change btn color in Bootstrap
- Make div scrollable
- Failed to decode downloaded font, OTS parsing error: invalid version tag + rails 4
- Chrome give error **Failed to load resource: net::ERR_NAME_NOT_RESOLVED** while other browser load images
- What is the difference between the selectors “.class.class” and “.class .class”?
- CSS: Creating textured backgrounds
- Insert image after each list item
- How to make the HTML link activated by clicking on the
- ?
- How to change text transparency in HTML/CSS?
- How do I hide the bullets on my list for the sidebar?
- limitations of using @Html.EditorForModel
- Transition of background-color
- How to implement max-font-size?
- How to float 3 divs side by side using CSS?
- How to override the properties of a CSS class using another CSS class
- HTML Width Percentage
- Circle button css
- force footer on bottom on pages with little content
- draw diagonal lines in div background with CSS
- How to add a color overlay to a background image?
- Change color of PNG image via CSS?
- css transition opacity fade background
- Better way to set distance between flexbox items
- Text-decoration: none not working
- How to set up fixed width for
? - How do I center an h1 in the body
- CSS3 Transition not working
- In CSS what is the difference between “.” and “#” when declaring a set of styles? [duplicate]