You are here

1 June 2011

Adding your css stylesheet to TinyMCE editor in WordPress admin panel.

Source code viewer
  1. # Copy this into your themes functions.php file
  2.  
  3. # Adds css stylesheet to wysiwygs preview in admin panel.
  4. if ( ! function_exists( 'css_to_mce' ) ) {
  5. function css_to_mce( $wp ) {
  6. $wp .= ',' . get_bloginfo( 'stylesheet_url' );
  7. return $wp;
  8. }
  9. }
  10. add_filter( 'mce_css', 'css_to_mce' );
Programming Language: PHP