Skip to content

How to display Last Modified date in Hestia ​

If you're running a news blog or where the content is constantly being updated then you might want to display the last modified date in your blog posts instead of the date of article being published. Hestia Pro users can do this with the built-in post metadata setting, while Hestia free users can use the child-theme method below.

In Hestia Pro ​

You do not need a child theme to display the last updated date in Hestia Pro:

  1. In your WordPress dashboard, go to Appearance > Customize > Blog Settings > Posts & Pages.
  2. In the Meta Data Section, add {hestia_updated_date}.
  3. Make sure the token does not include :hidden. For example, {hestia_updated_date:hidden} keeps the date in the page's markup but hides it from visitors.

For help customizing the author, publication date, date format, or blog-archive metadata, see How to change post meta data in Hestia.

In Hestia free ​

Displaying the last updated date in Hestia free requires a child theme. If you aren't using one already, follow these instructions to create a child theme.

In your child theme's functions.php file, add the following code at the end:

php
function hestia_show_updated_date_on_single() {

    global $post;
    $author_id        = $post->post_author;
    $author_name      = get_the_author_meta( 'display_name', $author_id );
    $author_posts_url = get_author_posts_url( get_the_author_meta( 'ID', $author_id ) );

    $output =
        sprintf(
        /* translators: %1$s is Author name wrapped, %2$s is Date*/
            esc_html__( 'Last updated by %1$s on %2$s', 'hestia-pro' ),
            /* translators: %1$s is Author name, %2$s is Author link*/
            sprintf(
                '<a href="%2$s" class="vcard author"><strong class="fn">%1$s</strong></a>',
                esc_html( $author_name ),
                esc_url( $author_posts_url )
            ),
            get_the_modified_time( get_option( 'date_format' ) )
        );

    return $output;
}

add_filter( 'hestia_single_post_meta', 'hestia_show_updated_date_on_single' );

This will update the date of the post every time a change has been made.

Save the file, and it should do it.

Was this helpful?