Created
September 14, 2018 12:45
-
-
Save rushijagani/c55ef3c788e86515a2298cbd06592c81 to your computer and use it in GitHub Desktop.
Remove published date from Post meta from Astra
This file contains 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 | |
/** | |
* Function to get Date of Post without published date. | |
*/ | |
if ( ! function_exists( 'astra_post_date' ) ) { | |
/** | |
* Function to get Date of Post | |
* | |
* @return html Markup. | |
*/ | |
function astra_post_date() { | |
$output = ''; | |
$format = apply_filters( 'astra_post_date_format', '' ); | |
$time_string = esc_html( get_the_date( $format ) ); | |
$modified_date = esc_html( get_the_modified_date( $format ) ); | |
$posted_on = sprintf( | |
esc_html( '%s' ), | |
$time_string | |
); | |
$modified_on = sprintf( | |
esc_html( '%s' ), | |
$modified_date | |
); | |
$output .= '<span class="posted-on">'; | |
$output .= '<span class="updated" itemprop="dateModified"> ' . $modified_on . '</span>'; | |
$output .= '</span>'; | |
return apply_filters( 'astra_post_date', $output ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment