Adding <small> tag inside WordPress Date Formatting function

Still learning my way around WordPress and its template functions, but basically I am just trying to quickly put a post date format into my design like they are in my HTML mark up below:

<span class="date">29 <small>JUN 2014</small></span>

.date {
    text-align: center;
    font-size: 60px;
    display: inline-block;
    line-height: 50px;
    color: #313131;
}

.date small {
    text-transform: uppercase;
    display: block;
    font-size: 14px;
    line-height: 20px;
}

Which is displaying as desired on the pages:

Read More

Wordpress Date

EDIT:

Using the links provided and suggestion by Bradley in his answer below. I now have the correct date format with this code:

<?php $my_date = the_date('j M Y', '<span class="date">', '</span>'); echo $my_date; ?>

How do I add the <small> tag in front of the M in the date?

Many Thanks

Related posts

Leave a Reply

2 comments

  1. Thanks for explaining, here is the wordpress codex on the_date function And here is a link on formatting

    I am unsure if the small tag is going to work in the date format section, if not, you will save it into a variable(see the codex), replace the small tag with a comma and use a php or js replace to switch the comma with the small tag, then echo it out in the place you want to render it.

    So in your case it would be the_date('d <small>D Y', '<span class='date'>', '</small></span>');