[Resolved] Changing the Copyright Message, full date

Home Forums Support [Resolved] Changing the Copyright Message, full date

Home Forums Support Changing the Copyright Message, full date

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #617279
    Tilo

    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

    #617442
    Leo
    Staff
    Customer Support

    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]

    #617603
    Tilo

    Add this snippet to … Where? What place?

    #617690
    Leo
    Staff
    Customer Support

    One of these methods: https://docs.generatepress.com/article/adding-php/

    Code Snippets is the easiest if you aren’t using a plugin.

    #617783
    Tilo

    Leo it works … thanks.
    How may I switch the result “7th July 2018” to a German date “07.07.2018”?

    #618043
    Leo
    Staff
    Customer Support

    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

    #618186
    Tilo

    Many thanks … it works.

    #618234
    Leo
    Staff
    Customer Support

    No problem!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.