[Resolved] copyright message

Home Forums Support [Resolved] copyright message

Home Forums Support copyright message

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #2300374
    Leo

    Hello,

    I was wondering if it would be possible to show the copyright message somewhere in the left or right sidebar rather than in the footer. I searched this forum but could not find anything. The reason I am asking is that it takes a lot of scrolling before the footer on my website is shown (so that it is in fact always out of sight) and having it in the sidebar would make it much more visible. See my website: http://www.myberlin.nl

    Many thanks!

    #2300377
    Fernando
    Customer Support

    Hi Leo,

    You can add this snippet:

    
    add_shortcode( 'insert_copyright', 'tu_copyright_shortcode' );
    function tu_copyright_shortcode() {
    	ob_start();
    	$my_site = ' myberlin.nl';
        echo '<div class="copyright-bar">© ' . date( 'Y' ) . $my_site . '</div>';
    	return ob_get_clean();
    }

    Adding PHP reference: https://docs.generatepress.com/article/adding-php/#code-snippets

    With this, you’ll have a shortcode you can use to add the copyright anywhere.

    The shortcode is [insert_copyright]

    #2300405
    Leo

    That’s great, Fernando! I have now added the shortcode as a widget on the right sidebar (widget = html code, I hope this is correct).

    There is just one small thing: when the website is opened it just says “© myberlin.nl” (so without the year). Only when I then open an article is the year also shown correctly, so: “© 2022 myberlin.nl”. Can you help me out, please?

    Many thanks!

    Regards

    Leo

    #2300410
    Fernando
    Customer Support

    I see. I modified the code above. Can you update the code you have with that?

    #2300414
    Leo

    Further to my message above I just noticed that the copyright year in the widget of the right sidebar changes according to the publication date of the article. What I really wanted was to just show the general copyright notice there, which is normally shown in the footer and which automatically changes when y new year begins. Sorry that I did not make this clearer. Thank you.

    #2300418
    Fernando
    Customer Support

    I see. I updated the code above once more. Can you try that instead?

    #2300460
    Leo

    Fantastic! Thank you, Fernando!

    #2300469
    Fernando
    Customer Support

    You’re welcome Leo!

    #2303905
    Leo

    Hello,

    I am still having another small issue with the copyright message. I have put it on both the footer and the top of the website, right aligned – which is fine. However, it is shown centered on both my tablet and my mobile device, although i put right aligned for the top of the website, which does not seem to have an effect. I could not find such an option for the footer.

    I was also wondering if I could change the language of the Generate Press menu: mine is in Dutch but it would be better to have it in English as it would be easier to refer to terms and menus here on this forum. Unfortunately, I could not find a setting to change the language.

    Again, many thanks for your help. I really love Generate Press and its amazing flexibility!

    PS my website is http://www.myberlin.nl

    #2303916
    Fernando
    Customer Support

    Can you try modifying the code you have into something like this:

    .copyright-bar {
        text-align: left !important;
    }

    As for the new issue, can you start a new topic regarding this?

    #2303994
    Leo

    Dear FErnando,

    Thanks again for your help. This is the snipped you recently created for me for the copyright message:

    add_shortcode( ‘insert_copyright’, ‘tu_copyright_shortcode’ );
    function tu_copyright_shortcode() {
    ob_start();
    $my_site = ‘ myberlin.nl’;
    echo ‘

    ‘;
    return ob_get_clean();
    }

    I really do not know how and where to add the additional code you just gave me.

    Thanks!

    I will open a new topic for the language question.

    Regards,

    Leo

    #2304001
    Fernando
    Customer Support

    The code here is CSS: https://generatepress.com/forums/topic/copyright-message/#post-2303916 – Add this in Appearance > Customize > Additional CSS.

    For the previous code – Adding PHP reference: https://docs.generatepress.com/article/adding-php/#code-snippets

    Yes, creating a new topic for that would be great. Thank you!

    #2304121
    Leo

    Hi Fernando,

    I have added the CSS you gave me under 2303916 to Appearance > Customize > Additional CSS, but this does not seem to do anything. And I left the previous code (which was for the set up of the copyright message) untouched. I am probably doing something wrong but I cannot figure out what.

    I have meanwhile started a new topic on the language issue.

    Again, my sincere thanks for your help!

    Leo

    #2304456
    David
    Staff
    Customer Support

    Hi there,

    try adding this CSS instead:

    .top-bar-align-right {
        text-align: right !important;
    }
    #2304499
    Leo

    Hi David,

    Great, that did the trick! How can I achieve the same for the footer, where the copyright message is still centered on my tablet and my smartphone. Sorry, CSS is beyond me…

    In general terms, which is the better option: Appearance > Customize > Additional CSS oder the plugin your collegue Fernando recommended to me the other day: Code Snippets? Or are they equally fine for adding code?

    Many thanks for your help.

    Regards,

    Leo

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