[Resolved] Display "last updated" date instead of "published" date

Home Forums Support [Resolved] Display "last updated" date instead of "published" date

Home Forums Support Display "last updated" date instead of "published" date

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #825233
    Uwe

    Hello,

    As the title describes, I’m trying to display “last updated” date instead of “published” date for all my blog posts.

    I tried the following CSS but it didn’t work, unfortunately:

    
    .posted-on .updated {
    display: inline-block;
    }
    .posted-on .updated + .entry-date {
    display: none;
    }
    
    .posted-on .updated:before {
    content: "Last Updated";
    }
    
    #825319
    David
    Staff
    Customer Support

    Hi there,

    try this:

    .page-hero time.updated {
        display: inline;
    }
    .page-hero time.published {
        display: none;
    }
    #825966
    Uwe

    Worked, thanks!

    #826059
    David
    Staff
    Customer Support

    You’re welcome

    #1148917
    rajkumarsm

    Hi David,
    I have added above CSS under Appearance – Simple CSS. But no luck. Do I need to modify functions file. If so what code I need to add. Please help.
    Here is my site link Software Testing Material
    Thanks.

    #1148955
    Suraj Katwal

    Hi Sumasri,
    You can also try this method to show last updated date in your GeneratePress Theme ==>How to Display Last Updated Date in GeneratePress Theme?

    #1149064
    David
    Staff
    Customer Support

    Hi there,

    you’ll find the CSS method required here:

    https://docs.generatepress.com/article/show-the-updated-post-date/

    The alternative is to use PHP to output the updated date:

    https://docs.generatepress.com/article/generate_post_date_output/#only-show-updated-date

    #1720805
    Tareq

    I am using this method in a couple of my sites but in a new site, this is not working. I tried using code snippets, gp child theme, and using main themes function, but nothing is working.
    But the other sites are perfectly showing update date. What may have gone wrong here? Please help

    #1721230
    Ying
    Staff
    Customer Support

    Hi Kelvin,

    Could you open a new topic for this?

    You can link us to the site in question using the private information field.

    Let me know 🙂

    #1805342
    To

    Hi David?
    Where to add below code? I also would like to display “last updated” for my blog posts.

    “.page-hero time.updated {
    display: inline;
    }
    .page-hero time.published {
    display: none;
    }”

    Thanks,

    #1805440
    Elvin
    Staff
    Customer Support

    Hi there,

    That code is CSS. Here’s how to add it in – https://docs.generatepress.com/article/adding-css/

    Although, we can’t be sure if that’s applicable to your site because that was written for the topic starter.

    If that one isn’t applicable, can you open a new topic about this? Let us check the site to provide the applicable solution.

    Let us know.

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