• Resolved purnama

    (@purnamacarpentry)


    Hello.

    I’m trying to make my website as light as possible. It is in Generatepress.
    For the footer section, I wish to have a dynamic year updated automatically.
    But, I want to have it without plugins.
    Is there any shortcodes I can use for this? I never have it in my mind to edit the theme editor.

    Really appreciate if someone comes in with the help.
    Thanks.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author Tom

    (@edge22)

    Hi there,

    Are you editing the current copyright message at the moment? I’m not able to see the footer – it just scrolls me back to the top.

    Best way is to build a simple shortcode:

    add_shortcode( 'year', function() {
        return date( 'Y' );
    } );

    Now you can use [year] to dynamically output the current year.

    Thread Starter purnama

    (@purnamacarpentry)

    Hello, Tom.
    Thanks for the theme.
    I apologize to reply this late.

    Right now I’m using this code, and it’s working last time I check.
    %copy% purnama carpentry – %current_year%
    I put it in the code section when I was customizing the footer.

    I willing to try the code you adviced, can you tell me where to put it?

    Thanks.

    Leo

    (@leohsiang)

    Tom’s code can be added using one of these methods:
    Adding PHP: https://docs.generatepress.com/article/adding-php/

    Thread Starter purnama

    (@purnamacarpentry)

    I tried the codesnippets method, and it seems like it’s working just fine.
    I don’t see any errors occured, and I think it works well.

    Thanks for the clue, Leo.
    And huge appreciation for Tom, for providing the theme.

    GBU you all.

    Leo

    (@leohsiang)

    Glad we could help ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Automatic Update in Copyright Footer’ is closed to new replies.