[Resolved] Copyright info with Elementor

Home Forums Support [Resolved] Copyright info with Elementor

Home Forums Support Copyright info with Elementor

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #557371
    Dave

    Hey guys, I am using Elementor Pro with GP Premuim. Elementor (confirmed through their support) doesn’t have an option for including “smart copyright” where it places the %copy% and current year code. Is there a way to bring that copyright content in to Elementor? I don’t want to have to remember to go back each year and change copyright years for every client.

    Thanks!

    #557595
    Leo
    Staff
    Customer Support

    Hi there,

    You mean to bring GP’s copyright function to Elementor?

    Unfortunately not…

    Perhaps just use GP for the copyright section?

    #559202
    Dave

    I thought about that but I like the flexibility with Elementor being able to insert custom headers and footers. What about a copyright shortcode that would take any text in that entire copyright section and being able to embed it in to Elementor as an element? I think people would find that extremely helpful especially with how popular it and other page builders are becoming.

    #559700
    Tom
    Lead Developer
    Lead Developer

    This should do it:

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

    Then you could use [get_the_year].

    #560166
    Dave

    Ok sweet. Should I just put that in functions.php?

    #560226
    Tom
    Lead Developer
    Lead Developer

    Yea 🙂

    #560289
    Dave

    Perfect, thanks!

    #560490
    Tom
    Lead Developer
    Lead Developer

    No problem 🙂

    #575597
    Michael

    Hi there,

    I have the same situation here (footer made with an Elementor Template).

    After I had put the code into functions.php there occurred a white screen and my site broke completely. I don’t know php at all and maybe I put the code into the wrong place (at the bottom of the file).

    I have restored the functions.php file now and I can access the WordPress Backend again.

    Now I put the code into the “Code Snippets” Plugin (the plugin which is recommended in the GP documentation “adding PHP”) and activated it so that it’s active for the whole site.

    Is this the right way to do it (also for being on the save side regarding to updates)?

    Where do I have to insert the [get_the_year]? Unfortunately, it doesn’t work when I try to put this in the text field of the Elementor Title Widget.

    Thank you in advance!

    #575738
    Tom
    Lead Developer
    Lead Developer

    That’s strange – perhaps your functions.php wasn’t set up correctly.

    Is your code snippet activated inside the Code Snippets plugin?

    #576505
    Michael

    Hi Tom,

    I hope my functions.php is allright? As mentioned I don’t now PHP 🙁
    Yes the snippet is activated (for the whole site) in the Code Snippets plugin.

    It works now! In the Elementor Footer Template the “copyright line” (the part at the very bottom in the footer) were the columns and in both were TITLE widgets. I don’t know why? Is it better to have title widgets there? I changed them now to TEXT-EDITOR widgets and voilà, it gets the year!

    Your code is now still in the Code Snippets plugin. Is it better to have it there (e.g. regarding updates) or should I better try to put it in the functions.php again?

    Thank you very much for your help!

    Best regards,
    Michael

    #576525
    David
    Staff
    Customer Support

    Hi Michael, keep it in the code snippets, never make changes to the parent themes functions or templates or they will be lost when the theme updates. If you were doing large amounts of editing then use a child theme.

    #576532
    Michael

    Hi David,
    Thank you very much for your answer/help.
    Ok, I’ll keep it in the code snippets then…
    Thank you!

    #576536
    David
    Staff
    Customer Support

    You’re welcome Michael, glad we could help

    #722896
    Aitor

    Hi,
    i added this code in child theme in functions.php (it existed from the beginning), i had created a footer in “footer header elementor” and it works. it catches the year in the copyricht 2018 xxxxx.
    but in the web site, it does not work, it appears “copyricht [get_the _year] xxxxx.”
    add_shortcode( ‘get_the_year’, ‘tu_get_the_year’ );
    function tu_get_the_year() {
    return date( ‘Y’ );
    }

    Should i change in child theme and in father theme as well? functions.php (father is bigger than child’s)

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