Title: Date Posting Twice
Last modified: March 25, 2019

---

# Date Posting Twice

 *  Resolved [Ashley Peach](https://wordpress.org/support/users/adventureswithpeach/)
 * (@adventureswithpeach)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/date-posting-twice/)
 * When I make a post the date shows up twice. How do I fix this?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdate-posting-twice%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/date-posting-twice/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/date-posting-twice/page/2/?output_format=md)

 *  [Jarret](https://wordpress.org/support/users/jarretc/)
 * (@jarretc)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/date-posting-twice/#post-11351057)
 * Hi, as you don’t have a live version for us to look at, which theme are you using?
   May be able to diagnose the issue further that way as it is most likely an issue
   with the theme code.
 *  [tferral](https://wordpress.org/support/users/tferral/)
 * (@tferral)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/date-posting-twice/#post-11351062)
 * First – that link your provided is to the localhost on your computer. No one 
   can open your site when you have it installed locally on your computer.
 * What changes have you made lately, before the date display problem.
 * I need a lot more information before I can even begin to help your.
    - WP release number
    - Theme name
    - what changes have been made before the problem began
    - everything you can tell me about the site
 *  Thread Starter [Ashley Peach](https://wordpress.org/support/users/adventureswithpeach/)
 * (@adventureswithpeach)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/date-posting-twice/#post-11353921)
 * Sorry! I am really new to this to please work with me here.
 * I am running WP 5.1.1
 * I am using the theme – Massage Clean
 * I now see when I make a change/edit to the post that is when the date shows up
   twice.
 *  [tferral](https://wordpress.org/support/users/tferral/)
 * (@tferral)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/date-posting-twice/#post-11354085)
 * Perhaps it is showing the date the post was first published and also the date
   the post was last updated.
 * Are the dates identical?
 * Is the time showing along with the date? Is the date and time the same or different?
 *  Thread Starter [Ashley Peach](https://wordpress.org/support/users/adventureswithpeach/)
 * (@adventureswithpeach)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/date-posting-twice/#post-11354125)
 * I am wondering that. ANd I wonder if when I make this ‘live’, it won’t show? 
   The time doesn’t change, just double enters the date.
 *  [tferral](https://wordpress.org/support/users/tferral/)
 * (@tferral)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/date-posting-twice/#post-11354187)
 * I just installed the Massage Clean theme and I’m seeing dates like this:
    March
   18, 2019March 21, 2019
 * That first date is the date the post was published and the second date is when
   it was last updated.
 * Are you seeing the same thing – two dates run together?
 * Here’s what the source shows for the time fields:
 * `<time class="entry-date published" datetime="2019-03-18T01:24:05-05:00">March
   18, 2019</time><time class="updated" datetime="2019-03-21T23:53:55-05:00">March
   21, 2019</time>`
 * Note the class names, the first is entry-date published’. The second is just “
   updated”.
 * On my system, the dates are date published and date updated.
 * Pull up one of your pages. Highlight just one of the date lines. Right click 
   on the highlighted text and select View Source.
 * Copy what you see and paste it into a reply. Let me see what is there.
 *  Thread Starter [Ashley Peach](https://wordpress.org/support/users/adventureswithpeach/)
 * (@adventureswithpeach)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/date-posting-twice/#post-11354230)
 * Tferral – I am seeing the same thing!
 * When I highlight-right click I do not have the option to ‘View Source’
 *  [tferral](https://wordpress.org/support/users/tferral/)
 * (@tferral)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/date-posting-twice/#post-11354238)
 * Have you a program with which you can look at and edit one of the files in the
   theme?
 * I think I found the spot where the date line is created when viewing an index
   page.
 * It is in the file: wp-content/themes/massage-clean/inc/template-tags.php on line
   42. It looks like this:
 * `$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time
   >;<time class="updated" datetime="%3$s">%4$s</time>';`
 * Change it to:
 * `$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time
   >&nbsp;<time class="updated" datetime="%3$s">%4$s</time>';`
 * The change is to insert   after the first “</time>”
 * &npsp is a way of coding in space so that it does not get removed as simple spaces
   can be in some situations.
 * Save the file and go look at your index page. There sould be a space between 
   the dates.
 * Let me know what you see.
    -  This reply was modified 7 years, 1 month ago by [tferral](https://wordpress.org/support/users/tferral/).
      Reason: removed duplicate text at bottom of reply
 *  [tferral](https://wordpress.org/support/users/tferral/)
 * (@tferral)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/date-posting-twice/#post-11354251)
 * Sorry – the menu item will be View Selection Source for highlighted text.
 * EDIT – that is for Firefox I don’t think Chrome has the same option.
 * If you are using Chrome, click on a blank place on the page and then right click
   and select View page source.
 * Then search for the word March in the source and then hit F3 until you find the
   line with the two dates on it.
 * You’ll see that the classes are different.
 * Edit – the line will begin with
 * `<div class="post-date"><span class="screen-reader-text"></span> <a href=`
    -  This reply was modified 7 years, 1 month ago by [tferral](https://wordpress.org/support/users/tferral/).
    -  This reply was modified 7 years, 1 month ago by [tferral](https://wordpress.org/support/users/tferral/).
 *  [tferral](https://wordpress.org/support/users/tferral/)
 * (@tferral)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/date-posting-twice/#post-11354489)
 * How’s it going?
 *  [tferral](https://wordpress.org/support/users/tferral/)
 * (@tferral)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/date-posting-twice/#post-11354519)
 * I made changes to two files and now I see, for example:
 * **Published:** March 18, 2019 1:24 AM **Updated:** March 21, 2019 11:53 PM
 * On the index page and no the single post page.
 * In file wp-content\themes\massage-clean\content-single.php
 * I changed the division with class=’postmeta to:
 *     ```
       <div class="postmeta">
                   <div class="post-date"><span style="font-weight:bold;">Published:&nbsp;</span><?php echo get_the_date(); ?>&nbsp;<?php echo get_the_time(); ?>
                   <time class="updated"> <span style="font-weight:bold;">Updated:&nbsp;</span>
                   <?php echo get_the_modified_date(); echo get_the_modified_time(). '&nbsp;'; ?></time>
   
                   </div><!-- post-date -->
                   <div class="post-comment"> | <a href="<?php comments_link(); ?>"><?php comments_number(); ?></a></div>
                   <div class="clear"></div>
               </div><!-- postmeta -->
       ```
   
 * In the file wp-content\themes\massage-clean\inc\template-tags.php it changed 
   the function named massage_clean_time_link() to:
 *     ```
       /**
        * Gets a nicely formatted string for the published date.
        */
       function massage_clean_time_link() {
       	$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
       	if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
       		$time_string = '<time class="entry-date published" datetime="%1$s">Published: %2$s</time>&nbsp;<time class="updated" datetime="%3$s">
       		Updated: %4$s</time>';
       	}
   
       	$time_string = sprintf( $time_string,
       		get_the_date( DATE_W3C ),
       		get_the_date(),
       		get_the_modified_date( DATE_W3C ),
       		get_the_modified_date()
       	);
   
       	// Wrap the time string in a link, and preface it with 'Posted on'.
       	return sprintf(
       		/* translators: %s: post date */
       		__( '<span class="screen-reader-text"></span> %s', 'massage-clean' ),
       		'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
       	);
       }
       ```
   
 * These are quick and perhaps dirty modifications but they work.
 * You need to contact the author of the theme and explain what is happening and
   give them the updates I made.
 * You need these changes made by the author. If you just modify the files yourself,
   an update to the theme could, likely wound eliminate the changes.
 * Basically tell them that they need to produce the date and time to look like 
   this:
 * **Published:** March 18, 2019 1:24 AM **Updated:** March 21, 2019 11:53 PM
 * On both the single post display and the index display.
 * I’m here if you need more help.
 *  [tferral](https://wordpress.org/support/users/tferral/)
 * (@tferral)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/date-posting-twice/#post-11354557)
 * I just looked at the support forum for that theme and it is empty.
 * If you go to [https://wordpress.org/themes/massage-clean/](https://wordpress.org/themes/massage-clean/)
   and click the preview button, you’ll see the formatting problem right there for
   the world to see:
 * October 17, 2008September 9, 2011
 * They don’t have a space between dates and the time isn’t show for either date.
 * The lack of a space is a bug and should be reported. Since I’m not using the 
   theme, it would be best for you to contact them.
 * Here is their contact page [https://flythemes.net/contact/](https://flythemes.net/contact/)
 * Are you using the free theme or the Pro version which you paid for?
 * Regardless, they should fix the space problem and format the line like I showed
   you in my previous reply:
 * **Published:** March 18, 2019 1:24 AM Updated: March 21, 2019 11:53 PM
 * Good luck
 *  [tferral](https://wordpress.org/support/users/tferral/)
 * (@tferral)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/date-posting-twice/#post-11354631)
 * Hang off on those changes, I’ve found problem in the code I showed for the file
   
   wp-content\themes\massage-clean\inc\template-tags.php
 * I’ll post the corrected code in a few minutes.
 *  [tferral](https://wordpress.org/support/users/tferral/)
 * (@tferral)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/date-posting-twice/#post-11354743)
 * I’ve tested the code below and it works fine with Version: 1.1 of the Massage
   Clean theme.
 * It will put a space between the dates, adds the times to the dates, add Published:
   and Updated:, and makes them bold.
 * Here’s the code I changed in the wp-content\themes\massage-clean\inc\template-
   tags.php
 * I replaced this entire function to make it easier to change:
 *     ```
       function massage_clean_time_link() {
       	$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
       	if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {		
       		$time_string = '<time class="entry-date published" datetime="%1$s"><span style="font-weight: bold;">Published:</span> %2$s</time><time class="updated" datetime="%3$s">&nbsp;<span style="font-weight: bold;">Udpated:</span>&nbsp;%4$s&nbsp; %5$s</time>';
       	}
   
       	$time_string = sprintf( $time_string,
       		get_the_date( DATE_W3C ),
       		get_the_date()  . '&nbsp; ' . get_the_Time(),
       		get_the_modified_date( DATE_W3C ),
       		get_the_modified_date(),
       		get_the_modified_time()
       	);
   
       	// Wrap the time string in a link, and preface it with 'Posted on'.
       	return sprintf(
       		/* translators: %s: post date */
       		__( '<span class="screen-reader-text"></span> %s', 'massage-clean' ),
       		'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
       	);
       }
       ```
   
 * Here are the changes for wp-content\themes\massage-clean\content-single.phpfile.
   I replaced an entire <div> tag to make it easier to make the changes:
 *     ```
       <div class="postmeta">
                   <div class="post-date"><span style="font-weight:bold;">Published:&nbsp;</span><?php echo get_the_date(); ?>&nbsp;<?php echo get_the_time(); ?>
                   <time class="updated"> <span style="font-weight:bold;">Updated:&nbsp;</span>
                   <?php echo get_the_modified_date(); echo ' '; echo get_the_modified_time(). '&nbsp;'; ?></time>
   
                   </div><!-- post-date -->
                   <div class="post-comment"> | <a href="<?php comments_link(); ?>"><?php comments_number(); ?></a></div>
                   <div class="clear"></div>
               </div><!-- postmeta -->
       ```
   
    -  This reply was modified 7 years, 1 month ago by [tferral](https://wordpress.org/support/users/tferral/).
      Reason: corrected the name of the theme
 *  [Jarret](https://wordpress.org/support/users/jarretc/)
 * (@jarretc)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/date-posting-twice/#post-11354862)
 * If you want to hide the updated post date without modifying any code you can 
   just use the following CSS in Appearance->Customize->Additional CSS
 *     ```
       .postmeta .updated {
       	display: none;
       }
       ```
   

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/date-posting-twice/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/date-posting-twice/page/2/?output_format=md)

The topic ‘Date Posting Twice’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 17 replies
 * 3 participants
 * Last reply from: [Ashley Peach](https://wordpress.org/support/users/adventureswithpeach/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/date-posting-twice/page/2/#post-11363868)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
