Top

How to Change the font size in wordpress post :Tutorial

Posted on March 31, 2009 by Suree   Print This Post Print This Post

Wordpress,without any doubt, is the best free online CMS on the earth.But as every one does some mistakes, wordpress is no exception.

While i was writing my previous post, i thought it would be better if i reduce the font size of a particular text.But i shocked to see there is no option for changing the font size in the word press editor.Soon did some reasearch and I am here with a small tutorial on  “How to change the font size of the text in a wordpress post”

Wordpress uses a third party editor called TinyMce.So while integrating the TinyMce Editor in the wordpress they have not included the Font size option.

So to include this option follow the following steps

1. Edit /wp-includes/js/tinymce/tiny_mce_config.php with a text editor like notepad.

2. Search for “$mce_buttons = apply_filters” (do not include “”)

3. You will find a line

$mce_buttons = apply_filters(’mce_buttons’, array(’bold’, ‘italic’, ’strikethrough’,'|’,'bullist’, ‘numlist’, ‘blockquote’, ‘|’, ‘justifyleft’,'justifycenter’, ‘justifyright’, ‘|’, ‘link’, ‘unlink’,'wp_more’, ‘|’, ’spellchecker’, ‘fullscreen’, ‘wp_adv’ ));

4. All the elements in the array which is passed as arguments are the icons that the editor will display    while editing,So if we want the font size option we just have to add fontsizeselect option the array.The line will be as follows after the edit.

$mce_buttons = apply_filters(’mce_buttons’, array(’bold’, ‘italic’, ’strikethrough’, ‘fontsizeselect ‘,’|',’bullist’, ‘numlist’, ‘blockquote’, ‘|’, ‘justifyleft’, ‘justifycenter’, ‘justifyright’, ‘|’, ‘link’, ‘unlink’,'wp_more’, ‘|’, ’spellchecker’, ‘fullscreen’, ‘wp_adv’ ));

5. Now save the file and upload it back (if you have downloaded and editing this ).

6. Try editing any post, now you will be seeing a new icon called font size next to strikethrough icon like this

7. If you didn’t get the icon even though u made the above changes, it be because of your cache, so try clearing the cache(ctrl+F5) and try again

You May Be Interested in Visiting these links also

Comments

3 Responses to “How to Change the font size in wordpress post :Tutorial”

  1. lice treatment on September 24th, 2009 7:34 pm

    Awesome! I appreciate you taking the time to tell us about this. I have a new site using the Atahualpa theme, and good golly….changing the font size and style is super hard…i will try this addon that you mentioned! Thanks again! Sheila

  2. Chelle on June 2nd, 2009 7:07 pm

    Hen: it’s been moved: wp-admin/includes/post.php

    the buttons code starts around line 1222 in that file

  3. Hen on May 12th, 2009 3:14 pm

    this doesn’t work in WP2.7

Feel free to leave a comment...
and oh, if you want a pic to show with your comment, go get a gravatar!





Bottom