Home Forums WoodMart support forum Shortcode [year] doesn't work in Footer Copyrights text area

Shortcode [year] doesn't work in Footer Copyrights text area

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #173456

    Ida
    Participant

    Hello,

    in order to have a dynamic year in the footer, i added code in function.php :

    function year_shortcode() {
    $year = date(‘Y’);
    return $year;
    }
    add_shortcode(‘year’, ‘year_shortcode’);

    and i placed the short code “[year]” inside “Copyrights text” area, under theme settings >> Footer.

    But in the browser appears [year], not “the year”/2020

    instead of that, I tried to use another code:

    function currentYear(){
    return date(‘Y’);

    but in the footer text copyright don’t admit to using:
    <?php echo currentYear(); ?>

    It is a simple code and I have found in the forum that you also advise it, I don’t know why it doesn’t work, please, may you help me?

    Thank you so much.
    Best regards,

    #173460

    Hello,

    Your provided WP Login details has not have full access to the site. Please provide me the complete access WP Admin Login details of your site so that I’ll check it for you.

    Best Regards.

    #173477

    Ida
    Participant

    Hello,

    yes, you have admin role. Please, find below the login, i reset the passw because i don’t remember it.

    Thank you so.
    Best regards,

    #173572

    Hello,

    I tried to login to your website using the new credentials and I was unable to login. Please provide with correct admin panel login details to check it myself and help you out accordingly.

    Best Regards.

    #173976

    Ida
    Participant

    Hello,

    oh, i’m so sorry. Please, find below the new password, this time checked.

    Thank you so.
    Best Regards,

    #174020

    Hello,

    Still I am not able to Install any plugin on your site, because your site is Multi-site and you provided only site user access not provided the Login details as an Admin for Multi-site, So please share the Admin Login details for Multi-site so that I’ll able to Install the WP File Manager plugin on your site and try to add the Code in your Theme Files.

    Best Regards.

    #174039

    Ida
    Participant

    Hello,

    please, find it below.

    Thank you so.
    Best regards,

    #174050

    Hello,

    I have fixed the issue on your website and now the footer copyrights are working absolutely fine on my end. Please clear the cache and check back.

    Screenshot for Clarification: https://ibb.co/1LYqmnc

    I have added the following code in the child theme functions.php file and its working absolutely fine.

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

    Best Regards.

    #174055

    Ida
    Participant

    Hello,

    yes! i see. It’s the same code i used, but now it works. Sure that i was doing something wrong.

    Thank you so.
    Best regards,

    #174150

    Most Welcome!!!..

    Well, Ida!.., it’s been great chatting with you! I hope I resolved your issues thoroughly.

    Let us know if there’s anything else we can do for you! You can always reach us at any time. We are always here to help you.

    Have a wonderful day.

    Topic Closed.
    Best Regards.

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘Shortcode [year] doesn't work in Footer Copyrights text area’ is closed to new replies.