Wordpress - Adding date and time to blog

blando89

New member
Joined
Apr 18, 2016
Messages
25
Points
0
Hello,

I am trying to figure how to add the date and time to my blog posts. I would also like to have my name by it as well. Any idea on how to do this? I looked through all the settings and not seeing anything.

Thanks!
 

arindamb

Member
Joined
Jul 11, 2013
Messages
255
Points
18
Hello,

I am trying to figure how to add the date and time to my blog posts. I would also like to have my name by it as well. Any idea on how to do this? I looked through all the settings and not seeing anything.

Thanks!
You mean you want to add date time and author name in your blog posts?

If so, go to single.php or category.php or the place you want to show date time and your name on each blog post

Adding this

Code:
<?php the_time('F jS, Y') ?>  by <?php the_author() ?>
Hope it helps!
 

blando89

New member
Joined
Apr 18, 2016
Messages
25
Points
0
Do you just add the php in the text of the post or is this in the settings somewher?
 

arindamb

Member
Joined
Jul 11, 2013
Messages
255
Points
18
arindamb
If your WP theme could not show date/time and author on its theme then you need to do it manually by adding this code into PHP file and at suitable place to show on.
 

blando89

New member
Joined
Apr 18, 2016
Messages
25
Points
0
Hm because if i go into Settings and General it shows the date and time selected etc. I do not know where the php file would be to add that.
 

arindamb

Member
Joined
Jul 11, 2013
Messages
255
Points
18
arindamb
I will go with Ron Killian' advice!

You should learn a bit about how to edit and build a wordpress theme. It will be helpful for you when working on Wordpress sites.

If not, change to a theme can support show date/time and author name as you wanted.
 

Ron Killian

New member
Joined
Dec 3, 2015
Messages
804
Points
0
For most people, that might not have much experience with editing wordpress theme's, it's some times better to find a different theme that does what you want. Pretty easy to mess up PHP code (I know from experience), and some times difficult to get the layout right.

Not trying to be negative, always good to learn, but some times :)
 

RebeccaDooley

New member
Joined
Dec 3, 2015
Messages
31
Points
0
To add Date and Time stamp in WordPress posts, you need to modify "index.php" file of the current active theme. Now check this code:

From:
Code:
<?php $elixir->timesince() ?> ago at <?php the_time() ?>
Replace with:
Code:
<?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?>
Thus, using this you can figure out the date and time in your WordPress blog posts.
 
Older threads
Replies
3
Views
2,412
Replies
0
Views
2,022
Replies
2
Views
5,513
Newer threads
Latest threads
Recommended threads

Latest postsNew threads

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top