Home>Support>Custom Editor Styles Ignored

Custom Editor Styles Ignored

I’m having the same problem described in this post regarding

add_editor_style

I’d like the editor’s typography to match my site as closely as possible, and to override up some of TinyMCE’s built-in styles, so I’d love for the editor widget to honor the custom styles. They work in the regular WP editor, but not in the SiteOrigin Editor widget.

See here for comparison: http://imgur.com/a/zeqb5

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 7 years, 1 month ago Alex S
    Hi, I Work Here

    Hi Amanda,

    This should be fixed in the latest update of the SiteOrigin Widgets Bundle, 1.9.7? If you’re not using this version, please try updating. If this issue is still occurring for you after updating, please try clearing your browser cache.

  2. 7 years, 1 month ago Amanda Russell

    Hi,

    It now appears to be trying to load the stylesheet, however I’m using a LESS parser to convert LESS files to CSS. This works fine in the normal editor, but breaks the widget.

    Please see the screenshot here: http://imgur.com/a/6hMRA

  3. 7 years, 1 month ago Amanda Russell

    I switched to a different parser that finds the latest cache file and enqueues that directly. The widget is no longer broken, but it is also not calling the styles. The native editor still loads the files fine, as does Black Studio’s TinyMCE widget, so I will use that one in the meantime. This is how I’m calling the style currently:

    <?php
    $editor_less_files = array( get_stylesheet_directory() . '/styles/content.less' => '/mysite/' );
    $editor_options = array( 'cache_dir' => get_stylesheet_directory() . '/styles/cache/content' );
    $editor_css_file_name = Less_Cache::Get( $editor_less_files, $editor_options );
    add_editor_style( get_stylesheet_directory_uri() . '/styles/cache/content/'.$editor_css_file_name );
    ?>
    
  4. 7 years, 1 month ago Alex S
    Hi, I Work Here

    Hi Amanda,

    I’m going to forward this thread to the development team to see if they have any ideas what’s going wrong. I would recommend trying the upcoming update to see if that helps at all as I know there were a number of additional editor changes that should resolve a lot of developer type issues.

  5. 7 years, 1 month ago Alex S
    Hi, I Work Here

    Hi Amanda,

    Here’s what the development team said:

    That looks like it should work.
    Only thing I can think of right now might be filter priority.
    So their call to `add_editor_style` is running after our call to `get_editor_stylesheets`

    To clarify, when is this code set to run – filter, priority, etc?

  6. 7 years, 1 month ago Amanda Russell

    I’m using add_editor_style() in my theme’s functions.php. It doesn’t have a priority parameter: Codex – add_editor_style()

  7. 7 years, 1 month ago Alex S
    Hi, I Work Here

    Hi Amanda,

    The hook that is adding the function that contains that style will have one – it’s very likely admin_init or after_setup_theme. Unless you’re adding the code directly to your functions.php without a hook. If that’s the case, please try adding it to one as it really shouldn’t be directly added to the functions.php.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More