How to Display Blog Post Meta Data in Your WordPress Themes

Recently, we got an email from a user asking: How do you add the byline (post author, post published date, and category) below your post title on WPBeginner. These post information bylines are referred to as post meta data in WordPress. In this article, we will show you how to display blog post meta data in your WordPress themes.

What is Post Meta Data?

Post meta data is the information you provide to viewers about each post. This usually includes the post author, post category, time of publishing, post tags, etc. Depending on the theme styling, post meta data can be placed in one of many positions like below post title, at the bottom of the post, top sidebar etc.

How to Display Byline like WPBeginner?

All you have to do is inside your post loop, paste the following code:

Note: only logged in editors will see the “Edit” link. Users will not.

Unlimited Possibilities

While what we have on our site is a very common example, displaying post meta data has unlimited possibilities. Depending on your theme, you can choose to style it creatively. Below are some screenshots to get the ideas rolling:

If you look at the image above, they show the date and author name right below the title. However, category, tags, and comments are shown at the bottom of the post.

Chris Coyier shows the date next to the post excerpt. The second number is the comments count.

Smashing Magazine shows the author name right below the title. For date, tags, and comments, they have an icon associated with each item.

Mennonites website shows the date, categories, author, and tags in the left sidebar.

As you can see that there really are unlimited possibilities when it comes to displaying your blog post meta data creatively.

It would be super helpful if the screenshots were of where in the code this would be and exactly what we’d be taking out/replacing. I use the NicheWebsiteTheme and it has both a “loop-single.php” and “loop.php” page with some code about dates…neither say published exactly, don’t know where that’s hiding as you get to choose…but also don’t know where else to look?

I’m actually trying to change published dates to last updated as you mentioned in another post that links to this one.

The reason why we don’t specify the exact location is because it varies from theme to theme. Also some people might want to display this after the title whereas others might want to display it at the bottom of their theme. We’d recommend asking your theme author about this.

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Get 20% off on PhotoPressPro theme for Photographers which comes with hundreds of options. View this Deal »

About WPBeginner

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).