CSS Style for WP Calendar Widget

As a WordPress theme developer, it’s easy to forget to include all the styles for the core WordPress classes. This includes styles for image alignments, captions, and widgets. To ensure that all necessary styles are included in your theme, it’s important to have a WordPress Theme Development Checklist.

Most of these classes are easy to customize, and you can create a standard CSS that you can use and customize for any theme you work on. In this article, we will share a simple style for your WordPress Calendar widget that you can copy and paste into your theme’s style.css file to give it a minimal look.

Calendar Widget CSS

Below is the CSS required to give your calendar widget a minimal look. Note that the shadow around the calendar is only for the image on the post.


/* calendar widget */

.widget_calendar {float: left;}

#wp-calendar {width: 100%; }

#wp-calendar caption { text-align: right; color: #333; font-size: 12px; margin-top: 10px; margin-bottom: 15px; }

#wp-calendar thead { font-size: 10px; }

#wp-calendar thead th { padding-bottom: 10px; }

#wp-calendar tbody { color: #aaa; }

#wp-calendar tbody td { background: #f5f5f5; border: 1px solid #fff; text-align: center; padding:8px;}

#wp-calendar tbody td:hover { background: #fff; }

#wp-calendar tbody .pad { background: none; }

#wp-calendar tfoot #next { font-size: 10px; text-transform: uppercase; text-align: right; }

#wp-calendar tfoot #prev { font-size: 10px; text-transform: uppercase; padding-top: 10px; }


Calendar Widget Style

Once you have added the CSS above to your WordPress theme, the calendar widget should look like the following image:

![Calendar Widget Style](https://cdn.searchenginejournal.com/wp-content/uploads/2014/08/Calendar-Widget-Style.png)

If it doesn’t, it’s possible that your theme already has some styles built-in for tables or the widget itself, which is overriding your newly added CSS. This is a very simple style widget, but it’s always easier to start with a simple style and go from there. Plus, who even uses the Calendar widget these days?

Do you use the calendar widget? Let us know in the comments below. As a developer, it’s important to style it in case someone using your theme does want to use it.

Stay in Touch


Related Articles