Take your website
To the next level
Discover our newly launched customization services and elevate your web projects to new heights.
Delegate tasks, save time, and unlock the power of professional WordPress outsourcing.

Okay
  Public Ticket #2841657
Current Year Shortcode or Code
Closed

Comments

  •  1
    Noctris started the conversation

    I'm setting up my weebsite, and in the Bottom area of the footer where the Copyright year is I see that the year is hardcoded, is there a way to put a shortcode or a piece of code in there that will display the Current year instead of the hardcoded one?

    Thanks!

  •  7,092
    Oliver replied

    Hi,

    Give me wp-admin and FTP access

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  •  1
    Noctris replied

    Hello,

    Unfortunately, that won't be an option. 

    Im a front-end developer, whatever you need me to do you can write it here. I just wanted to avoid writing any additional code if this is already a part of the theme itself.

    Thanks!

  •  7,092
    Oliver replied

    HI,

    Give me wp-admin access at least. I need to see your settings, by default we don't such shortcode, I will give hints on how it make it. 

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  • 3DYNAMISCH replied

    Hello, 

    I might be able to solve this quite quick as I implemented the same as you require Noctris.

    If you install(ed) the child theme which is located in your theme's downloadable files, add the following to the functions.php file.

    //Allow shortcodes in widgets
    add_filter ('widget_text', 'do_shortcode'); function year_shortcode () {
    $year = date_i18n ('Y');
    return $year;
    }
    add_shortcode ('year', 'year_shortcode');

    Now you can use the following shortcode in your footer.

    [year]

    Luckily this theme sees the footer as a widget, though some don't, which in turn can make this a bit harder.

    I hope this works as well for you as it does for us.

    If for some reason it does not work on the default footer text block (which only adds text), use codexThemes's  "custom footer", I am 100% certain that it works there.

    If you require a full run through, I'll be happy to share a step by step basis with screenshots.

    @Gregor, it might be handy to add this piece of code in the themes by default, as to my knowledge, most people tend to prefer it.

  •  7,092
    Oliver replied

    Ok, thank you, we'll add it to theme theme in the future theme updates

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver