Last active
June 10, 2019 14:57
-
-
Save Nikschavan/3d0b0b74b13dd97884ab98d15cd0d8fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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