Title: Problem with get_the_date() function
Last modified: August 21, 2016

---

# Problem with get_the_date() function

 *  Resolved [dynamitri](https://wordpress.org/support/users/dynamitri/)
 * (@dynamitri)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/problem-with-get_the_date-function/)
 * Hi all,
 * I am having a problem with the `get_the_date()` function on my WordPress, at 
   [http://www.dynamitri.pl](http://www.dynamitri.pl). After hours of investigation
   and working through trial and error I have pretty much narrowed it down to the
   issue being a problem with `get_the_date()` rather than anything else.
 * I have slightly amended a part of my **utility.php** file, and went from:
 *     ```
       /** Prana Post Date */
       function prana_post_date() {
   
       	$post_date = esc_html( get_the_date() ) . " " . esc_attr( get_the_time() );
   
       	/** Output */
       	$output = sprintf( '<span class="entry-date" title="%1$s"><a href="%2$s" title="%3$s" rel="bookmark">%1$s</a></span>', $post_date, esc_url( get_permalink() ), the_title_attribute( 'echo=0' ) );
       	return $output;
   
       }
       ```
   
 * to
 *     ```
       /** Prana Post Date */
       function prana_post_date() {
   
       $post_date = esc_html ( get_the_date() ) . ( prana_entry_meta_sep() );	
   
       	/** Output */
       	$output = sprintf( '<span class="entry-date" title="%1$s"><a href="%2$s" title="%3$s" rel="bookmark">%1$s</a></span>', $post_date, esc_url( get_permalink() ), the_title_attribute( 'echo=0' ) );
       	return $output;
   
       }
       ```
   
 * What I wanted to achieve is
 * a) getting rid of the timestamp (as don’t really need it), and
    b) having the
   date followed by the backslash metadata separator (triggered by the prana_entry_meta_sep()
   function).
 * I have achieved my aim in 50%, as evidenced on [http://www.dynamitri.pl](http://www.dynamitri.pl).
   I have the metadata separator after the date. However, for some reason, as soon
   as I placed the `prana_entry_meta_sep()` function in an appropriate place for
   it to show up where intended, some code has cropped up that precedes the date.
   Code that I cannot get rid of no matter how hard I try, without reducing the 
   site to the point of giving me syntax errors. What happens right now is the date
   is preceded by three characters:
 * `\ ">`
 * Oddly enough, they are not hyperlinked to anything (the date itself is). I went
   through all the .php files in my WordPress editor (not all of those on the server,
   mind you – didn’t get down to that yet). I’ve searched for those three characters–
   no results there. Searched through the **utility.php** file that I have altered,
   hoping to find those 3 mysterious chars there. Again, no result.
 * At some point, however, I have attempted to insert `get_the_date()` to the bottom
   of my post (the code of which is in the **content.php** file), and, alas, it 
   appeared with `\">` at the very beginning there as well. This has made me almost
   100% certain that it’s `get_the_date()` that’s causing some issues suddenly. 
   What is going on in there and why, however, I have no idea.
 * All suggestions as to what could be done to sort this issue out would be really
   appreciated, seeing I have spent the better part of yesterday (and today so far)
   on trying to work out what is causing the problem to no avail. Slowly running
   out of ideas here. Maybe some fresh outlook, and a mindset not fatigued by racking
   their brains for hours no end, will be able to help. Many thanks!
 * Best,
 * Dynamitri

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/problem-with-get_the_date-function/#post-3990242)
 * it is caused by the fact that `$postdate` is also used as the title attribute
   in the span (where it must not have any html tags);
 * possibly change the corresponding line to (example):
 *     ```
       $output = sprintf( '<span class="entry-date" title="%4$s"><a href="%2$s" title="%3$s" rel="bookmark">%1$s</a></span>', $post_date, esc_url( get_permalink() ), the_title_attribute( 'echo=0' ), esc_html( get_the_date() ) );
       ```
   
 *  Thread Starter [dynamitri](https://wordpress.org/support/users/dynamitri/)
 * (@dynamitri)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/problem-with-get_the_date-function/#post-3990246)
 * This has done the job. Amazing! Thank you so much 😀
 * _[closed as duplicate of [http://wordpress.org/support/topic/theme-prana-entry-meta-separators-in-posts%e2%80%a6-again?replies=11](http://wordpress.org/support/topic/theme-prana-entry-meta-separators-in-posts%e2%80%a6-again?replies=11)–
   please do not open new topics while the original topics are still open]_

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Problem with get_the_date() function’ is closed to new replies.

## Tags

 * [Coding](https://wordpress.org/support/topic-tag/coding/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [function](https://wordpress.org/support/topic-tag/function/)
 * [get_the_date](https://wordpress.org/support/topic-tag/get_the_date/)
 * [Issues](https://wordpress.org/support/topic-tag/issues/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [dynamitri](https://wordpress.org/support/users/dynamitri/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/problem-with-get_the_date-function/#post-3990246)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
