[Resolved] Show "Updated Post Date" in Header Element

Home Forums Support [Resolved] Show "Updated Post Date" in Header Element

Home Forums Support Show "Updated Post Date" in Header Element

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #686425
    Tommy

    Hi, I’ve read and implemented this for the blog posts page and works:
    https://docs.generatepress.com/article/show-the-updated-post-date/

    …but would like to show this in the Header Element as well.

    Here’s the header element [code]:
    https://cl.ly/1f9b45d1f5d8

    Here’s the header element [public facing]:
    https://cl.ly/af1a2d06c070

    Thanks, and pardon my ignorance – I’m not a coder ๐Ÿ™‚

    #686700
    David
    Staff
    Customer Support

    Hi there,

    we can do this by creating a shortcode:

    function post_modified_date(){
     return get_the_modified_date();
    }
    add_shortcode( 'modified_date', 'post_modified_date' );

    https://docs.generatepress.com/article/adding-php/

    Then you just need to add the [modified_date] to the Header element content

    #686902
    Tommy

    Awesome – that works! Thank you!

    #686906
    David
    Staff
    Customer Support

    Glad i could help ๐Ÿ™‚

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