Title: Display published date using shortcode?
Last modified: August 22, 2016

---

# Display published date using shortcode?

 *  Resolved [joleksow](https://wordpress.org/support/users/joleksow/)
 * (@joleksow)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/display-published-date-using-shortcode/)
 * Hey Mat,
 * Would it be possible to get the shortcode generator to allow you to include the“
   published” date for each link? This way users could see exactly when new links
   were added so they can tell if something is new to them.
 * Thanks!
    John
 * [https://wordpress.org/plugins/simple-links/](https://wordpress.org/plugins/simple-links/)

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

 *  Plugin Author [Mat Lipe](https://wordpress.org/support/users/mat-lipe/)
 * (@mat-lipe)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/display-published-date-using-shortcode/#post-5572456)
 * Hi John,
 * You can tap into the simple_links_link_output filter to append the date.
    If 
   you add the following to your active theme’s functions.php file, it should do
   what you want:
 *     ```
       add_filter( 'simple_links_link_output', 'sl_add_date' );
       function sl_add_date( $output ){
       	return str_replace( '</a>', ' ' . get_the_date() . '</a>', $output );
       }
       ```
   
 * Hope this helps!
 *  Thread Starter [joleksow](https://wordpress.org/support/users/joleksow/)
 * (@joleksow)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/display-published-date-using-shortcode/#post-5572460)
 * Hi Mat,
 * Thanks for this tip! However, it seems like the date that’s being retrieved from
   get_the_date is the date of the page the links are appearing on and not the links
   themselves.
 * I got this working by modifying the code you provided to look more like this:
 *     ```
       add_filter( 'simple_links_link_output', 'sl_add_date' 10, 3);
       function sl_add_date( $output, $meta, $link ){
               $sl_date = mysql2date ('F j, Y', $link->post_date);
       	return str_replace( '</a>', ' ' . $sl_date . '</a>', $output );
       }
       ```
   
 * This is working great, but if you have other ideas for how to do this more elegantly
   I would be all ears.
 * Thanks!
    John

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

The topic ‘Display published date using shortcode?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/simple-links_3d6e81.svg)
 * [Simple Links](https://wordpress.org/plugins/simple-links/)
 * [Support Threads](https://wordpress.org/support/plugin/simple-links/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-links/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-links/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-links/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [joleksow](https://wordpress.org/support/users/joleksow/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/display-published-date-using-shortcode/#post-5572460)
 * Status: resolved