Skip to content

Instantly share code, notes, and snippets.

@shubhw12
Created October 12, 2020 16:13
Show Gist options
  • Save shubhw12/9a753c2b60f95898b1e0b9b5ecbf4689 to your computer and use it in GitHub Desktop.
Save shubhw12/9a753c2b60f95898b1e0b9b5ecbf4689 to your computer and use it in GitHub Desktop.
Show both last updated and published date in the post meta.
function your_prefix_post_date( $output ) {
$format = apply_filters( 'astra_post_date_format', '' );
$modified_date = esc_html( get_the_modified_date( $format ) );
$modified_on = sprintf(
esc_html( '%s' ),
$modified_date
);
$separator = ' /';
$separator = apply_filters( 'astra_post_meta_separator', $separator );
$published_string = _('Published : ' , astra );
$updated_string = _('' . $separator . ' Updated : ' , astra );
$updated_output .= '';
$updated_output .= ' ' . $modified_on . '';
$updated_output .= '';
$modified_output = $published_string . $output . $updated_string . $updated_output;
return $modified_output;
}
add_filter( 'astra_post_date', 'your_prefix_post_date' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment