wordpress snippets last updated   : October 6, 2014
we now have 641 snippets

Add TinyMCE editor to post/page title input field

wordpress snippet

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.

( example screenshot )
snippet :  PHPcopy
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');

Did you like this post? If so please share it with your friends. Thanks!

  • Anonymous

    Great snippet! I wonder is there any way to display and use only selected items of tinyMCE? Surely we don’t need to have the uploader buttons for the title area :)

    • http://wpsnipp.com Kevin Chard

      Thanks, glad you like the snippet, I think we can remove items however I’m not sure how easy it would be to do that just for the TinyMCE used for the title.

      • Anonymous

        how to remove unused items from tinymce? a good idea for a future snippet =) 

  • http://zeaks.org/ Zeaks

    Thanks for this. Is there any way to have this display in the html editor as well or instead of the visual? – opps, posted on the wrong article, sorry.

  • cajebo

    Nice addition/snipt, but… why?

jqsnipp.com | we just launched jquery snippets website