Archived topic
Changing the Copyright Message, full date
7 replies · Started by marquardt on July 6, 2018
Is it possiblke to enter the whole date into the Copyright Message?
Means like this: 06.07.2018
So far I know %current_year% only. How to use DAY and MONTH?
Regards, Tilo
Hi there,
Add this snippet to create a shortcode:
add_shortcode( 'footer_date', 'lh_footer_date' );
function lh_footer_date() {
ob_start();
echo date('jS F Y');
return ob_get_clean();
}
Then add this shortcode inside copyright message:
[footer_date]
Add this snippet to ... Where? What place?
One of these methods: https://docs.generatepress.com/article/adding-php/
Code Snippets is the easiest if you aren't using a plugin.
Leo it works ... thanks.
How may I switch the result "7th July 2018" to a German date "07.07.2018"?
Here it is:
add_shortcode( 'date', 'tu_term_description' );
function tu_term_description() {
ob_start();
echo date('d.m.Y');
return ob_get_clean();
}
More info here: https://codex.wordpress.org/Formatting_Date_and_Time
Many thanks ... it works.
No problem!