Add TinyMCE editor to post/page title input field

Adding this snippet to the functions.php of your wordpress theme will add the TinyMCE editor to the title input field of your wordpress posts and pages.

 

 

function tinymce_title_js(){ ?>
<script type="text/javascript">
jQuery(document).ready( tinymce_title );
function tinymce_title() {
jQuery("#title").addClass("mceEditor");
tinyMCE.execCommand("mceAddControl", false, "title");
}
</script>
<?php }
add_action( 'admin_head-post.php', 'tinymce_title_js');
add_action( 'admin_head-post-new.php', 'tinymce_title_js');
function tinymce_title_css(){ ?>
<style type='text/css'>
#titlewrap{border:solid 1px #e5e5e5 !important;}
tr.mceLast{display:none;}
#title_ifr{height:50px !important;}
</style>
<?php }
add_action( 'admin_head-post.php', 'tinymce_title_css');
add_action( 'admin_head-post-new.php', 'tinymce_title_css');

Be Sociable, Share!

Leave a comment