It depends on how this gets rendered in the theme you’re using. As you want to change things in one place to look different to the rest of the site, you’ll need to track down where that is and change the date format there. Finding where it is might be tricky but once you do it should be clear how to change format of the date.
If you add the theme you’re using to your post, someone might be able to track down where to change this and give you more specific instructions.
Here’s how I did what you want to do with a clean installation of the ‘twentytwenty’ theme. These steps might be different but this is just an example of what you need to do if you don’t already know there this gets rendered.
Hunting for the code
- I looked in the theme for the files which print a single post, which in some themes are called
single.php
and in this one was calledsingular.php
. - Found that this doesn’t do much except output parts that get rendered by the files in
template-parts
, so I had a look in there. Candidates that seemed like they might contribute to the post being displayed were content.php and entry-header.php. - With a bit of exploration I found entry-header.php was responsible for the header on the posts with the author and date and other stuff, and that it used a function called
twentytwenty_the_post_meta
to print out that date! - Dug a bit more, found the code in
inc/template_tags.php
, followed that function call and found this line which prints the date:
<a href="<?php the_permalink(); ?>"><?php the_time( get_option( 'date_format' ) ); ?></a>
From there, you can see that the_time
takes a format string and you can give it any new string you want e.g.:
<a href="<?php the_permalink(); ?>"><?php the_time( "F Y" ) ); ?></a>
Searching…
Or, another approach if you know how to do it is search through all the files in your theme for e.g. the id/class of the div surrounding the date in your post, or perhaps the the_time
function.