How to Use Dropcaps in WordPress & Blogger Posts and Pages

Learn how can you insert drop cap into WordPress or Blogger blogs automatically & manually.

Dropcap is mostly the very first letter of a paragraph, which is styled differently with comparatively massive font size. Dropcaps make interesting blends to article reading experience by improving the focus of a reader.

Here is an example:

dropcap example

How to use the dropcaps in WordPress & Blogger?

There are three ways to use the dropcaps in WordPress, one by using simple CSS, the other by installing a WordPress plugin and the third by using inbuilt text settings in gutenberg

Automatically Inserting Dropcap to all WordPress posts using CSS

This one is quite easy and can be done by using a simple CSS edit. All you need is to find your post-content’s class which in my case is entry-content. You can find it by using inspect element feature of your web browser.

inspect element to get post class

Now all you need is to add the CSS code to Additional CSS tab in customizer. to modify .entry-content p:first-child:first-of-type:first-letter class style, where .entry-content is usually the entry content class for all WordPress themes.

.entry-content p:first-child:first-of-type:first-letter {
Your formatting css here 
} 

For example, writing

.entry-content p:first-child:first-of-type:first-letter { 
float: left; 
padding: 10px 6px 10px 10px; 
font-size: 60px; 
color: #161616;
font-weight: bold; 
line-height: 1; }

will make the first letters of all WordPress posts dropcap-ed. This method also works for Blogger blogs. Just insert the following CSS into your blog:

.post p:first-child:first-of-type:first-letter {  float: left;  padding: 10px 6px 10px 10px;  font-size: 60px;  color: #161616; font-weight: bold;  line-height: 1; }

Here .post is the entry content class for all blogspot blogs.

By installing a WordPress Plugin (Auto/Manual) [WP only]

There are not too many WordPress plugins available for adding dropcaps into posts/pages and the ones that are available have not been updated since a long time. Drop Caps and Drop Cap Shortcode are two useful plugins which appear to work with latest version of WordPress, they don’t declare compatibility with WordPress 5.0+ though. Drop Caps automatically first letter of all posts a dropcap while Drop cap Shortcode does the same but by manually inserting a shortcode for each post. Initial Letter is one more plugin to explore.

Manually adding Dropcap by CSS & custom class

We can assign an HTML class to each letter to which we want a dropcap to be shown and then do proper styling modifications using CSS. In this tutorial, we are assigning a class dropcapfor a span element to which we want to visually render a dropcap. Add the following custom CSS code into your theme’s style.css file or adding to Additional CSS tab in customizer.

.entry-content p span.dropcap {
     float: left;
     padding: 10px 6px 10px 10px;
     font-size: 60px;
     color: #161616;
     font-weight: bold;
     line-height: 1;
}

After you finished adding this custom CSS, you can assign dropcap class to span element for the first letter in WordPress post/page editor.

For example adding,

 <span class="dropcap">E</span>
E icon

in back-end, you will get left aligned   on the front-end with all other text content right to it.

Drop Cap

You can further customize dropcap design by modifying above CSS. For example you want a white dropcap text to be placed inside a black box, you can add the following CSS:

.entry-content p span.dropcap {
float: left;
padding: 10px 10px 10px 10px;
font-size: 60px;
color: #ffffff;
background-color: #161616;
font-weight: bold;
line-height: 1;
}

This will result into:

dropcap dark

My dropcap CSS has dark text with a yellowish background and a hover effect. I used the following custom code:

.entry-content p span.dropcap {
-webkit-border-radius: 50;
-moz-border-radius: 50;
border-radius: 30px;
float:left;
font-size: 60px;
padding: 10px 20px 10px 20px;
background: #f2ea50;
color:#161616;
font-weight: bold;
font-family: Lora, serif;
line-height: 1;
text-decoration: none;
}
.entry-content p span.dropcap:hover {
color: #ffffff;
background:#161616;
text-decoration: none;
}

The manual CSS3 styling method also works with Blogger blogs. Just insert the appropriate CSS in the Layout editor and then use dropcap span class. On the blogger.com blogs, all you need is to replace

.entry-content p span.dropcap

by

.post span.dropcap

Gutenberg Text Styles

Gutenberg and WordPress since v5.0 – support Drop Cap text settings that can be used to show a large initial letter to any paragraph.

While writing the content, make sure that you have the desired paragraph selected and then click on the gear icon to activate the formatting sidebar. There in Text Settings in the Block segment – you can toggle Drop Cap to activate the drop cap for a paragraph.

How to Use Dropcaps in WordPress & Blogger Posts and Pages 2

1 comment
  1. TY for the article worked out great for me. I searched all over for this today and this article helped me with great success. Any articles on using images as dropcaps? Seen some nice ones around but no tutorials.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

You May Also Like
creating custom wp widgets
Read More

Newbie’s Guide : Creating Custom WordPress Widgets

Sarah Parker teaches the basics of plugin development with how to create custom WordPress widgets for your customary needs.
For those who run WordPress powered websites understand the importance of adding widgets on their site. Widgets are a great way to add content and additional features on your website. They make it extremely easy for you to simply drag and drop several elements such as sidebar, header, footer, of your website and thus making the most out of its functionality. By utilizing widgets correctly, you can make your website useful for your visitors. And the best thing about them is, you can use them anywhere you want, thus helping users to find more content on your website. Many of the WordPress users always search for the perfect WordPress widget that will help them do exactly what they want, but with a little technical knowledge and coding skills, you may find it easier for you to create your own WordPress custom widget. In this tutorial, I am going to show you the ways through which you can create your custom widget. For a better understanding, I'll be covering some extra points that you need to understand before you actually start creating the widget itself.