How to

How to add time on post WordPress without plugin

How to add time on post WordPress without plugin





The first, when you create a WordPress site, Template WordPress default doesn’t show time with the post content. It’s a complicated way for you If you can’t create code calling for show time on WordPress post content.
Now It is no longer difficult for you, Just do the following simple steps on the below ( Copy code and past on your site ).

Wordpress add time post

Code show time in post content WordPress

1.Copy code on the below

	  Hours <span class="post-date updated"><span class="post-date updated"><time itemprop="datePublished" content="<?php the_modified_date('g:i a'); ?>"><?php the_modified_date('g:i a'); ?></time> </span><span>

2.Past on the Address of WordPress – AppearanceTheme Editor on code Single Post (single.php), Example: We use Flex Mag WordPress template will need put code on the below.

<div class="post-info-date left relative">
														<span class="post-info-text"><?php _e( 'Posted on', 'mvp-text' ); ?></span> <span class="post-date updated"><time class="post-date updated" itemprop="datePublished" datetime="<?php the_time('Y-m-d'); ?>"><?php the_time(get_option('date_format')); ?></time></span>
														
														
														&nbsp; Hours&nbsp;<span class="post-date updated"><span class="post-date updated"><time itemprop="datePublished" content="<?php the_modified_date('g:i a'); ?>"><?php the_modified_date('g:i a'); ?></time> </span><span>
														
														
														<meta itemprop="dateModified" content="<?php the_modified_date('Y-m-d'); ?>"/>
													</div><!--post-info-date-->

3. Click Update File and reload your site on Browser again.

Wordpress code show date time on post content
Add time on post wordpress

Conclusion
It’s a one way of show time in post content with WordPress website without using a plugin.

Most Popular

To Top