DropCaps on your WordPress blog

How do I do a dropcaps on the first letter of a post?

DropCaps is the name for the effect where the first letter of the first paragraph in an article drops below the line of text, and is displayed in a larger font-size than the other normal letters.

This can be done using BBCode quicktags. First, add this to your style sheet:

 #fp:first-letter {
 font-size : 300%;
 font-weight : bold;
 float : left;
 margin-right: 3px;
 }

then add following code to file /wp-includes/js/quicktags.js and put them among edButtons:

 edButtons[edButtons.length] =
 new edButton('ed_capdrop'
 ,'CapDrop'
 ,'<p id="fp">'
 ,'</p>'
 ,'c'
 );

You will now see a CapDrop quicktag in your edit window.

Amazing what you find while rooting around for other stuff…

Author: Eric Erickson

Share This Post On

Submit a Comment

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