WpCode.net

Daily Wordpress Code Snippet

How to attach the Tiny MCE editor to the wp Excerpt

| 0 comments

Pin It

This snippet help you to add the TinyMCE editor to the Excerpt screen in the post Panel. Simply paste the code in your function.php file Continue reading

function tinymce_excerpt_js(){ ?>
<script type="text/javascript">
	jQuery(document).ready( tinymce_excerpt );
            function tinymce_excerpt() {
		jQuery("#excerpt").addClass("mceEditor");
		tinyMCE.execCommand("mceAddControl", false, "excerpt");
	    }
</script>
<?php }
add_action( 'admin_head-post.php', 'tinymce_excerpt_js');
add_action( 'admin_head-post-new.php', 'tinymce_excerpt_js');
function tinymce_css(){ ?>
<style type='text/css'>
	    #postexcerpt .inside{margin:0;padding:0;background:#fff;}
	    #postexcerpt .inside p{padding:0px 0px 5px 10px;}
	    #postexcerpt #excerpteditorcontainer { border-style: solid; padding: 0; }
</style>
<?php }
add_action( 'admin_head-post.php', 'tinymce_css');
add_action( 'admin_head-post-new.php', 'tinymce_css');

Leave a Reply

Required fields are marked *.

*