This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

WordPress Font Size

Description

This plugin does one thing: adds the HTML, JS, and CSS to the page (minified, of course)
to add a font size adjust to the top right of the viewport. Adds a class to the body HTML element to allow your CSS to make all the layout
and font size changes your heart desires!

How it works

  1. Click on the fontsize buttons
  2. AJAX Request to validate & save the new size
  3. jQuery Changes the body class for instant results
  4. Subsequent page navigation maintains the size without any Flash of Wrong Sized Text (FOWST)

Screenshots

  • Clicking on the fontsize button increments or decrements the font-size-{$number} applied to the body of the page

Installation

Please Note

The default installation of this plugin will have no visible effect on your theme.
You must add css to specify the size of the font adjustments, this plugin only adds the
body class = font-size-{$number} to allow your CSS to do the tweaking.

See the FAQ for configurable constants.

Demo CSS:
This will change the font size of all paragraph elements.
.font-size-1 p
{
font-size: 0.8em;
}
.font-size-2 p
{
font-size: 0.9em;
}

other rules here

.font-size-7 p
{
font-size: 1.7em;
}
To target other elements:

.font-size-7 p, .font-size-7 h1, .font-size-7 h2 .(etc...) {
    font-size: 1.7em;
}

FAQ

Where is the admin screen?

There is none. The only configuration can be done by adding the below constants to your wp-config.php file.
You’ll need to author your CSS to take advantage of the stateful classes added to the element.

How do I customize the number of levels?

Add the following constants to your wp-config.php file, adjusting the levels to your liking.

define('WP_FONTSIZE_MAX', 7);
define('WP_FONTSIZE_DEFAULT', 3);
define('WP_FONTSIZE_MIN', 1);
How do I disable the including of the CSS?

This disables the CSS that lays out the font size indicator in the top right of the screen.
Use this to override the CSS with your own styles.

define('WP_FONTSIZE_CSS', false);
How do I use the font size adjustor in my template?

This lets you use the plugin inside a template, by using the wp_fontsize::html() method. This will display the interface using the tag:

<?php wp_fontsize::html(); ?>

To disable the default html adjustor, make sure you add this to your wp-config.php:

define('WP_FONTSIZE_HTML', false);

Reviews

Read all 3 reviews

Contributors & Developers

“WordPress Font Size” is open source software. The following people have contributed to this plugin.

Contributors

Translate “WordPress Font Size” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.