steve.fm

A work in progress

Displaying Dates for Every Post

Early on, I noticed a problem where the date was displaying for some of my posts and not others.

I did some quick Googling and found out there’s actually a WordPress Codex page for that the_date() function that recommends using a different function if you want to return the date for multiple posts made on the same day. While some people might just want to display the date for the top post and let others assume that all the posts following are from the same date, I want the date to be on every post.

In case you’re curious, I’m going to update the metadata section in my content.php file to use the get_the_date() function instead:

        <div class="blog-post-metadata">
            <?php the_author(); ?> <br>
            <?php echo get_the_date(); ?>
        </div>

I can also imagine a world where I make a post heading that contains the date for all posts within that date… and where I remove the author information tag as well. It doesn’t make much sense to display the author long-term for a site where I plan on being the only author. The name of the blog should give some indication.

Read more about Building Steve.fm