Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Remove date from related posts and change “Related posts”

  • #6776
    Avatar photo[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”

    #6777
    Avatar photoBob
    [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

    #6778
    Avatar photo[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”
    }

    #6779
    Avatar photoBob
    [anonymous] wrote:

    This is what I changed but there was no difference

    It has to work, save the theme settings or restart the app.

    #6780
    Avatar photo[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

    #6782
    Avatar photoBob

    what is the location of the edited language file?

    #6783
    Avatar photo[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.

    #6785
    Avatar photoBob

    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 fileshttps://getpublii.com/docs/translate-publii-theme-to-another-language.html#overridinglanguagefile

    #6786
    Avatar photo[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;
    }