Title: Shortcode Displaying as Text
Last modified: August 24, 2016

---

# Shortcode Displaying as Text

 *  Resolved [jacksghost](https://wordpress.org/support/users/jacksghost/)
 * (@jacksghost)
 * [11 years ago](https://wordpress.org/support/topic/shortcode-displaying-as-text-1/)
 * I’m trying to use a very basic date shortcode on a page and the shortcode itself
   keeps displaying as text instead of displaying the date.
 * I added this to my /functions.php page:
 *     ```
       function LongDate(){
       	return date(‘Y’);
       }
       add_shortcode(‘mylongdate’, ‘LongDate’);
       ```
   
 * Then, I added [mylongdate] to my page in the editor and it will only display 
   the actual shortcode [mylongdate] instead of the date. I tried adding the shortocde
   in both the Visual and Text tabs in the editor and that makes no difference.
 * I am developing this site on a temp URL so I have not installed Jetpack yet. 
   Does Jetpack have to be installed for shortcodes to work?

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

 *  [schulte](https://wordpress.org/support/users/schulte/)
 * (@schulte)
 * [11 years ago](https://wordpress.org/support/topic/shortcode-displaying-as-text-1/#post-6097521)
 * Hey jacksghost,
 * I added a filter and removed some curly quotes. Give `[long_date]` a try!
 *     ```
       function my_long_date() {
       	return date('Y');
       }
       add_shortcode('long_date', 'my_long_date');
       add_filter('my_long_date', 'do_shortcode');
       ```
   
 *  Thread Starter [jacksghost](https://wordpress.org/support/users/jacksghost/)
 * (@jacksghost)
 * [11 years ago](https://wordpress.org/support/topic/shortcode-displaying-as-text-1/#post-6097692)
 * Hey schulte,
 * Of all the silly things, it was the curly quotes. I believe I copy/pasted the
   function online and did not even notice the single quotes were curly. It works
   now with or without the add_filter line.
 * Thanks!

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

The topic ‘Shortcode Displaying as Text’ is closed to new replies.

## Tags

 * [date](https://wordpress.org/support/topic-tag/date/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [jacksghost](https://wordpress.org/support/users/jacksghost/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/shortcode-displaying-as-text-1/#post-6097692)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
