How To Add Author Name And Date Under Post Title In WordPress?
September 26th, 2016 | by Ravi Chahar || 28 Comments |
Are you developing a WordPress theme? Are you trying to configure the single post appearance? Do you want to add author name and date under post title in WordPress?
In this post, I am going to walk you through the process which can help you to understand the concept of WordPress functions to display date under post title and the author.
You just have to embed the WordPress functions in the HTML and PHP coding. There is only one line of the code which would do the work for you.
Let Me Show You How Can You Add Author Name And Date Under Post Title In WordPress?
First of all, it would be great if you know the WordPress theme file structure. Let me tell you that the output of the single posts is handled by the single.php file present in your theme.
If you are using any theme and you want to add only the date or only author then it can be done. But it is recommended to show the published date and the author.
Let me provide you the proper code.
This code will display date, the author name under the blog post title. And when you login to your WordPress admin panel then you would see an edit link using which you can edit any blog post.
You can modify this code using a little bit of HTML. It would be great if you modify it by adding into a paragraph tag so that you can design it later.
And a few words which would show that the post is published on the date by the author.
It’s your choice whether you choose to display “published or posted”.
If you want to display the author name before the date then just rearrange the codes.
If you want to add author name and date under post title in WordPress theme you have to edit your current theme from the editor or using the cPanel. Just find the single.php file and add this code under the title of the blog post.
You can use this code wherever you want to display the author name and the date.
Isn’t That So Easy To Add Author Name And Date Under Post Title In WordPress?
Most of the web developers face such kind of problem. And if you are trying to develop your first WordPress theme then you would be happy to know that the code shown above would help you to show the post meta data.
You all know that every web developer provides a different code. But the WordPress functions remain the same. You can alter the appearance using CSS.
If you still face any problem, feel free to ask.