Archived topic
How to change shortcode date
4 replies · Started by Atefan on March 16, 2021
Viewing posts 1–5 of 5
I added once this code for date:
add_shortcode( 'footer_date', 'lh_footer_date' );
function lh_footer_date() {
ob_start();
echo date_i18n ('j. F Y');
return ob_get_clean();
}
and it looks like this:
17.03.2021
how to change the shortcode to look like this?
March 17, 2021
Regards
i got it.
add_shortcode( 'footer_date', 'lh_footer_date' );
function lh_footer_date() {
ob_start();
echo date('F j, Y');
return ob_get_clean();
}
Nice one. Thanks for letting us know.
To add to this:
Perhaps you'll find this useful:
https://generatepress.com/forums/topic/shortcode-for-current-month/#post-1695345
Thank YOU!
No problem. :)
This archived topic is closed to new replies.