Forum Replies Created

Viewing 1 replies (of 1 total)
  • I had the same basic need — drop caps plugin — and couldn’t believe how hard this was to find. So in the end I wrote it myself, first plugin I’d ever done and it’s about 3 lines of code! (Not including the css — another 3). I’m really impressed by the power of the WP plugin scheme.

    First thought was that I’d do span around the first char, but what if the first char is a tag? Starts to get complex. Ok so I went back to look at the CSS solution p:first-letter. But I only want it on the first para right? Easy, so assign a p class with drop cap only to the first para. But the whole idea is to do this automatically, not to have to use a quicktag or something.

    So that’s easy, do the plugin to insert p class=bigfirstchar before the post text. But this breaks xhtml because no closing p. No problem, just change the priority of the plugin so that it runs first, before the built in function which closes open xhtml tags. Tada! Working fine.

    You get:

    • Big first char on first para only
    • Works using css so minimal weight no issue if the first part of a post is a link

    Minor issue is that this looks different in firefox and IE so graphic designers may blanche, but for the rest of us the simplicity probably wins out.

    Download it here:

    http://www.printfhelloworld.com/wordpress-plugin-big-first-character.html

    Printf

Viewing 1 replies (of 1 total)