Remove date from related posts and change “Related posts”
-
January 11, 2022 at 8:16 am #6776
[anonymous]
I am using Mercury 2.2 and I’ve managed to scrub most of the dates. However they are still appearing under “Related posts”. Is there a way to remove the dates here?
Also can I change the wording across the site from “Related Posts” to say “Related Items”
January 11, 2022 at 12:02 pm #6777
Bob
[anonymous] wrote:Is there a way to remove the dates here?
You should edit the Related Posts section in the post.hbs file (Documents ▸ Publii ▸ sites ▸ YOUR_SITE ▸ input ▸ themes ▸ YOUR_THEME)
To preserve your custom code and prevent it being overwritten the next time the theme is updated, please ensure that you have created override files; these are, essentially, copies of the existing theme files that are stored separately from the main theme files → https://getpublii.com/dev/theme-overrides/[anonymous] wrote:Also can I change the wording across the site from “Related Posts” to say “Related Items”
Edit the language file, more about it you can read in the user documentation https://getpublii.com/docs/translate-publii-theme-to-another-language.html
January 11, 2022 at 12:40 pm #6778
[anonymous]
Thanks for that. After changing the language file, the “Related Posts” at the bottom of each post/page didn’t change. I guess the wording is being pulled from somewhere else.
This is what I changed but there was no difference
“post”: {
“publishedBy”: “By”,
“publishedOn”: “Published on”,
“lastUpdatedDate”: “This article was updated on”,
“previousPost”: “Previous Item”,
“nextPost”: “Next Items”,
“relatedPosts”: “Related items”,
“comments”: “Comments”
},“tags”: {
“tagsPageTitle”: “Categories”,
“description”: “All Categories”,
“post”: {
“1”: “Item”,
“default”: “Items”
}January 11, 2022 at 1:42 pm #6779
Bob
[anonymous] wrote:This is what I changed but there was no difference
It has to work, save the theme settings or restart the app.
January 11, 2022 at 1:53 pm #6780
[anonymous]
I double-checked everything. The json file as described. Restarted Publii when it didn’t work. Then I posted here. Then I checked the json file again and restarted Publii. No change.
Add it looks like this at the bottom of every page
January 11, 2022 at 1:57 pm #6782
Bob
what is the location of the edited language file?
January 11, 2022 at 2:02 pm #6783
[anonymous]
Where the documentation said to edit it – in the Mercury themes file as pictured. You can see it is also the only file that has been changed in that folder.
January 11, 2022 at 3:50 pm #6785
Bob
This is the wrong location. The themes directory is used to store theme files which are then applied to user sites.
You have to edit the language file in your site location (Documents ▸ Publii ▸ sites ▸ YOUR_SITE ▸ input ▸ themes ▸ YOUR_THEME)To preserve your custom phrases and prevent it being overwritten the next time the theme is updated, please ensure that you have created an override language file; these are, essentially, copies of the existing theme files that are stored separately from the main theme files → https://getpublii.com/docs/translate-publii-theme-to-another-language.html#overridinglanguagefile
January 12, 2022 at 5:52 am #6786
[anonymous]
[anonymous] wrote:Is there a way to remove the dates here?
If you preferred not to edit the post.hbs file, you could try hiding the dates by adding this to “Custom CSS”:
.post__related time { display: none; }