[Support request] How to set this place as “Last updated”

Home Forums Support [Support request] How to set this place as “Last updated”

Home Forums Support How to set this place as “Last updated”

  • This topic has 5 replies, 3 voices, and was last updated 6 months ago by Fernando.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #2347298

    Hi there, I want to set the default post date into the text “Last updated” like this screenshot

    The site in example using Marketer “site library template”. So in case I want to use the “Scribe” template in site library how can I set it?

    Customer Support

    Hi Trang,

    The site you linked is using the updated date.

    Scribe template is using a block element - page hero for the single posts, the post date can be switched to the updated date easily within the block element like this:


    Hi Ying, thank you.

    But what if I don’t want to use the “page hero block element” that’s available on Scribe and only want to use simple title & updated date like the site in sample? Can you advice? Thank Ying 🙂

    Customer Support

    Hi Trang,

    You can use a Filter. Try adding this Snippet:

    add_filter( 'generate_post_date_output', function( $output, $time_string ) {
        $time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">Published on: %2$s</time>';
        if ( get_the_date() !== get_the_modified_date() ) {
            $time_string = '<time class="entry-date updated-date" datetime="%3$s" itemprop="dateModified">Last Updated on: %4$s</time>';
        $time_string = sprintf( $time_string,
            esc_attr( get_the_date( 'c' ) ),
            esc_html( get_the_date() ),
            esc_attr( get_the_modified_date( 'c' ) ),
            esc_html( get_the_modified_date() )
        return sprintf( '<span class="posted-on">%s</span> ',
    }, 10, 2 );

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


    Thank Fernado, I will try & give a feedback later! Nice day, friend!

    Customer Support

    You’re welcome Trang! Nice day to you as well!

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