Skip to content

Instantly share code, notes, and snippets.

@Nikschavan
Last active June 10, 2019 14:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nikschavan/3d0b0b74b13dd97884ab98d15cd0d8fe to your computer and use it in GitHub Desktop.
Save Nikschavan/3d0b0b74b13dd97884ab98d15cd0d8fe to your computer and use it in GitHub Desktop.
<?php // don't copy this line in your code
/**
* Display only last modified date in the post metadata.
*
* @param String $output Markup for the last modified date.
* @return void
*/
function your_prefix_post_date( $output ) {
$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
);
$output .= '<span class="posted-on">';
$output .= '<span class="post-updated" itemprop="dateModified"> ' . $modified_on . '</span>';
$output .= '</span>';
return $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