Bambang pramusintha

How to Add a Character Counter to the WordPress Post Excerpt Box

In Excerpt Box, JQuery, Tutorial, Wordpress Tutorial on July 9, 2012 at 10:11 am

Why would you need a character counter on your excerpt box?

Certainly it seems like a character counter in WordPress post token is far more useful for the post content meta box. However, the active theme you may have very specific requirements for how long should your quote. If you want to be a perfectionist about your quote and do not want to see them cut the ellipse, then you will want to keep the length of your quotes to a certain number of characters. This is where the quote character counter will help.

Here is a handy little trick of recently. This piece counter lets you add character to the quote box on the screen edit your posts, as pictured below:

You can add this to your functions.php file or create your own little plugin for it :

function excerpt_count_js(){ echo ‘// <!–[CDATA[
jQuery(“#postexcerpt .handlediv”).after(”

Excerpt length: character(s).

jQuery(“#excerpt”).keyup( function() {
// ]]>’; } add_action( ‘admin_head-post.php’, ‘excerpt_count_js’); add_action( ‘admin_head-post-new.php’, ‘excerpt_count_js’);

Add a little piece of code if you want to try to keep the quote you get disconnected or a little more uniform. Many thanks to Kevin Chard for posting the code above in


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: