Snippet: Enhance Post Editor by Adding Font Family, Size and Styling Row

In our earlier post, we explained how you can change styling of Post Editor. In this tutorial, we will show you a trick to create a new row in post editor giving you ability to change text font family, size, style, converting text to superscript or subscript and adding a horizontal rule. It is pretty simple and straight. You just need to place following snippet in your “functions.php” file.

Snippet

add_filter("mce_buttons_3", "editor_third_row");
function editor_third_row($buttons) {
    $buttons[] = 'fontselect';
    $buttons[] = 'fontsizeselect';
    $buttons[] = 'styleselect';
    $buttons[] = 'hr';
    $buttons[] = 'del';
    $buttons[] = 'sub';
    $buttons[] = 'sup';
    $buttons[] = 'cleanup';

    return $buttons;
}

Result

Post Editor Third Button Bar

Post Editor Third Button Bar

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>