WpCode.net

Daily Wordpress Code Snippet

How to add Tiny MCE to the post title

| 0 comments

Pin It

This will add a TinyMce editor to title field in the posts and pages tab, you can customize style font and format to your title.

To use this snippet just add the code to your function.php theme file. Continue reading


function tinymce_title_js(){ ?>

<script type="text/javascript">// <![CDATA[
	jQuery(document).ready( tinymce_title );
            function tinymce_title() {
		jQuery("#title").addClass("mceEditor");
		tinyMCE.execCommand("mceAddControl", false, "title");
	    }
// ]]></script>&nbsp;

<?php }<br ?>add_action( 'admin_head-post.php', 'tinymce_title_js');
add_action( 'admin_head-post-new.php', 'tinymce_title_js');
function tinymce_title_css(){ ?>

<?php }<br ?>add_action( 'admin_head-post.php', 'tinymce_title_css');
add_action( 'admin_head-post-new.php', 'tinymce_title_css');

Leave a Reply

Required fields are marked *.

*