How to display the initial publication date + update in a post (Pro version using Integrity stack)?

Hi, Guys!

As I must confess that I am not a php wizard, your advice would be greatly appreciated about adding the currently not displayed initial publication date (see enclosed screenshot) after the updated one.

FYI here is my Child Theme’s functions.php file copy:

    function x_integrity_entry_meta() {

        //
        // Date.
        //

        $date = sprintf( '<span><time class="entry-date" datetime="%1$s">%2$s</time></span>',
          esc_attr( get_the_date( 'c' ) ),
          esc_html( get_the_date() )
        );

        //
        // Last updated
        //

        $lastupdate = ' <span class="updated"><i class="dashicons dashicons-calendar"></i>&nbsp;&nbsp;Article actualisé le '. get_the_modified_time('j F Y') . '</span>';

        //
        // Output.
        //
}

With thanks in advance,

Victor

Hello Victor,

Thanks for writing in! Adding the updated date in your post items will require additional PHP coding which is beyond the scope of our support already. We may be able to guide you instead by referring you to this link:

With that article, you may combine the PHP code into the following snippet:

$date = sprintf( '<span><time class="entry-date" datetime="%1$s">%2$s</time></span> | <span>Updated Date: <time class="entry-date" datetime="%3$s">%4$s</time></span>',
          esc_attr( get_the_date( 'c' ) ),
          esc_html( get_the_date() ),
          esc_attr( get_the_modified_time( 'c' ) ),
          esc_html( get_the_modified_time() )
        );

To learn more about how to get the date of your post, please check out this codex: