Thesis Theme Tip: How To Add Drop Caps To All Posts At Once

You hate having to add the class drop_cap to every single post right? and you probably don’t want to use any plugins to do this, so let me show you what I did to have drop caps on every post without me having to add the class manually.

The firs thing you have to do, and is probably going to suck, depending on how many posts you have written, is to remove the drop cap class from every post that already has it.

Now, go your Theis OpenHook plugin and add the following code to any textbox on the page.

Note: This works on every WordPress theme, you just have to find the name of the class that contains the post and use that instead of .entry-content. The php can be added as a function or directly to the theme.

<?php
if(is_single())
{
?>
<style type="text/css">
div.entry-content > p:first-child:first-letter, div.entry-content p:first-child:first-letter
{
font-size: 3.571em;
line-height: 0.76em;
padding: 0.04em 0.12em 0px 0px;
color: #888;
float: left;
}
</style>
<?php
}
?>

This is actually Thesis’ default CSS for the class "drop_cap", and by putting the CSS inside an if that checks if the page is a single post we have managed to make sure that drop caps are only visible on single posts.