davidgagne.net

  • About
  • Archives
  • Twitter
  • Facebook
  • bartender.live
  • GitHub
  • LinkedIn

WordPress Mod: DropCaps

March 13th, 2005 @ 3:18 pm PST

In which I explain how to create dropcaps

WordPress Mod:  DropCaps

The chances of me ever using the WordPress str QuickTag are pretty slim, so I replaced it with a drop-capper. (The T in this paragraph should appear as a dropcap for you if you’re using a browser that handles CSS properly.)

Pretty nifty, I think.

Want to do it?


NOTE: As of WordPress 2.04 the quicktags.js file has been moved to wp-includes/js/ and is no longer located in wp-admin!

Open the file wp-admin/quicktags.js and look for the lines that add the str quicktag. They look like this:

edButtons[edButtons.length] = 
new edButton('ed_strong'
,'str'
,'<str>'
,'</str>'
,'b'
);

Change them to this:

edButtons[edButtons.length] = 
new edButton('ed_dropcap'
,'DropCap'
,'<span class="dropcap">'
,'</span>'
,'b'
);

Then add this class to your stylesheet:

.dropcap{
	float: left;
	font: bold 250%/normal Verdana, Arial, sans-serif;
	margin-bottom: -5px;
}

I was going to create this as a my first real plug-in, but the the_content() function echos and doesn’t actually return an editable variable, so it got all tricky and I said screw it. If anyone knows of a way to get the_content() to return a variable, let me know and I’ll convert this to a plug-in. I’m afraid I am not quite yet a master of PHP, and I didn’t want to start screwing around with the core WP files that control the output of the_content(), so …

More posts tagged:
Amazon / code / css / hacks / wordpress

More posts categorized:
blogtech Web Design

More posts from:
March 2005 / 2005

Post navigation

Previous Post
Previous Post Ornithological Question
Next Post
Next Post Protect Images with .htaccess

Search


Your Cocktail Companion

Your Cocktail Companion

Discover what drinks you can make from the alcohol you have at home and become a first-class mixologist with bartender.live for iOS.

  • Make Beautiful Cocktails

© David Vincent Gagne. All rights reserved. Custom WordPress Theme by Jacket Industries.