Decorative Caps
Filed under: Presentation plugins | Back to: Homepage
ou can see this plugin in action right here at the beginning of this post. Notice how the “Y” is a fancy image of a “Y”? This is a plugin that I call Decorative Caps and is now available for download.
Update September 1, 2007: Version 1.1 has been released. The major change in this version is that an options page has been created to allow the user control over the CSS styling of the image (height, width, padding, etc.), specify a CSS class if you want to use a class from your stylesheet instead of the plugin settings, and specifying whether you want to use the decorative cap only on the post pages or on the front page as well.
Update September 4, 2007: Version 1.2 has been released. A minor change in the options page allows for a bit more control over where the decorative caps appear on your blog (home page, individual posts, individual pages).
Installing and using is very easy:
- Download Decorative Caps
- Unzip the file into your wp-content/plugins folder (this will create a directory called “scs-decorative-caps” which contains the plugin PHP page and the folder with the image files in it)
- Activate the plugin and view the results on your site!
- (New in version 1.1) Use the “Decorative Caps” options page in your admin interface to control the CSS styling of the image and specify some other options as well.
The image files that I used are from Leo’s Icon Archive (click on “Decorative Caps” on the left-hand side when you get there), and are freely available. If you wish to use different image files, the only specifications to work with this plugin would be:
- Image must be square in dimension (equal width and height)
- Image width and height must be at least 35 pixels, to avoid any degradation of the image (if you use a smaller image, make sure that you specify the correct dimensions in the options)
- Image names must be single lower-case letters followed by “.gif” in all lower-case (i.e., “a.gif, b.gif, etc.”)
Simply replace the images in wp-content/plugins/scs-decorative-caps/images with your own image files and the result will be immediate.
Note: This plugin does some very rudimentary checking to make sure that the first character is really an alpha character. It’s by no means perfect, and I have observed the following behavior:
If the first element is the start of a tag (for example <p>), the code looks to the first character beyond that. However, if the first character is a space, or if the first character beyond the opening tag is another tag, the plugin stops trying to find an initial letter in that particular post.
I’m not precisely sure how best to figure in all the possibilites. But this should work fine for you if you generally start your post with text (or at best an opening paragraph tag). Any thoughts?
