Do you want to show post meta data in your WordPress theme? Post meta data includes information like the post author, date, and categories. This guide will show you how to add this information to your theme.
What is Post Meta Data?
Post meta data is extra information about a post. It helps readers know more about the content. Common meta data includes:
- Post author
- Post date
- Post categories
- Post tags
- Post comments
Why Display Post Meta Data?
Showing post meta data has many benefits. It helps readers find related posts. It also gives credit to the author. Plus, it shows when a post was published.
How to Display Post Meta Data in Your Theme
To display post meta data, you need to edit your theme files. You will need basic knowledge of HTML and PHP. Here is a simple guide:
Step 1: Backup Your Theme
Before making changes, always backup your theme. This way, you can restore it if needed.
Step 2: Find The Right Template File
Next, find the template file you need to edit. Common files include:
single.php
– for single postsindex.php
– for the main blog pagearchive.php
– for archive pages
Open the file in a code editor.
Step 3: Add Code To Display Post Meta Data
Now, add the code to display the meta data. Here are some code snippets you can use:
Display Post Author
php the_author(); ?
Display Post Date
php the_date(); ?
Display Post Categories
php the_category(', '); ?
Display Post Tags
php the_tags(); ?
Display Post Comments
php comments_number(); ?
Place the code where you want the meta data to appear.
Step 4: Save And Test
Save your changes. Then, visit your site to see how it looks. Make sure the meta data is showing correctly.

Credit: www.wpbeginner.com
Customizing Post Meta Data
You can customize the meta data to match your theme. Here are some tips:
Change The Date Format
Use the the_time()
function to change the date format:
php the_time('F j, Y'); ?
This code will display the date as “Month Day, Year”.
Add Css For Styling
Use CSS to style the meta data. Add classes to the HTML:
php the_author(); ?
php the_time('F j, Y'); ?
php the_category(', '); ?
Then, add CSS to style the classes:
.post-meta {
font-size: 14px;
color: #666;
}
.post-meta .author, .post-meta .date, .post-meta .categories {
margin-right: 10px;
}

Credit: www.bu.edu
Using Plugins to Display Post Meta Data
If you are not comfortable with code, use a plugin. Here are some popular plugins:
- Meta Box: This plugin lets you add custom meta boxes.
- Custom Post Meta: This plugin lets you display custom fields.
- Advanced Custom Fields: This plugin lets you add complex meta data.
Install and activate the plugin. Follow the plugin’s instructions to display meta data.
Frequently Asked Questions
What Is Post Meta Data In WordPress?
Post meta data includes information like author, date, categories, and tags.
How To Display Author Name In WordPress?
Use the template tag `the_author()` in your theme’s file.
Can I Show Post Date In WordPress Themes?
Yes, use the `the_date()` template tag in your theme’s file.
How To Add Categories To WordPress Posts?
Use `the_category()` template tag in your theme to display categories.
Conclusion
Displaying post meta data in your WordPress theme is easy. It helps readers and improves your site. You can use code or plugins to add meta data. Always remember to backup your theme before making changes. Happy coding!