- This topic has 21 replies, 4 voices, and was last updated 1 year, 1 month ago by
Ying.
-
AuthorPosts
-
August 1, 2022 at 10:24 pm #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!
August 1, 2022 at 10:40 pm #2300377Fernando 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]
August 1, 2022 at 11:41 pm #2300405Leo
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
August 1, 2022 at 11:49 pm #2300410Fernando Customer Support
I see. I modified the code above. Can you update the code you have with that?
August 1, 2022 at 11:56 pm #2300414Leo
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.
August 2, 2022 at 12:09 am #2300418Fernando Customer Support
I see. I updated the code above once more. Can you try that instead?
August 2, 2022 at 12:50 am #2300460Leo
Fantastic! Thank you, Fernando!
August 2, 2022 at 12:56 am #2300469Fernando Customer Support
You’re welcome Leo!
August 4, 2022 at 11:54 pm #2303905Leo
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
August 5, 2022 at 12:06 am #2303916Fernando 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?
August 5, 2022 at 1:36 am #2303994Leo
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 ‘© ‘ . date( ‘Y’ ) . $my_site . ‘‘;
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
August 5, 2022 at 1:39 am #2304001Fernando 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!
August 5, 2022 at 4:45 am #2304121Leo
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
August 5, 2022 at 8:02 am #2304456David
StaffCustomer SupportHi there,
try adding this CSS instead:
.top-bar-align-right { text-align: right !important; }
August 5, 2022 at 8:47 am #2304499Leo
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
-
AuthorPosts
- You must be logged in to reply to this topic.