TinyMCE Advanced
[resolved] How to use custom CSS and remove default styles (3 posts)

  1. iriscreativo
    Posted 4 years ago #

    Hi everyone.
    Finally I found the perfect combination for this, here´s the trick:

    1. Install this plugin and customize the toolbars as you wish, including the "Styles" dropdown menu. You'll see the default styles (Wpgallery, wp-caption and so on...)

    2. Go to http://www.wdmac.com/how-to-use-custom-styles-in-the-word-press-post-editor and read carefully point number 3.
    Use the link "Download the code in TXT" and modify functions.php
    This will knock down the default styles!

    3. I create the css file but just added the line
    @import url("style.css"); to load my own styles from the file styles.css of the theme.

    4. Go back to functions.php and see line
    $init['theme_advanced_styles'] = 'style_01=style_01,style_02=style_02';
    where style_01 and style_02 are your custom styles.
    That will show your styles inside the "Styles" dropdown menu.

    4. Almost there... once you do this, remove the line
    add_filter( ‘mce_css’, ‘tdav_css’ );
    in function.php, as user Bones advised.
    By commenting this line you'll see your custom styles not only in the dropdown menu, but in the WYSIWYG editor.

    I hope this help. Don't be afraid, it's more simple that it sounds! :


  2. insurgenesis
    Posted 3 years ago #

    I cannot see how you got it to work though.
    It simply causes parse errors for me.
    Does it work in 3.4 or is it precisely the fix we were hoping for here:

    Why, if I may ask, did you include the @import?

  3. insurgenesis
    Posted 3 years ago #

    Which versions of WP and the plugin are you on? - because I don't see "import editor-style.css"...

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • TinyMCE Advanced
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic