Skip to content

Instantly share code, notes, and snippets.

@rushijagani
Created September 14, 2018 12:45
Show Gist options
  • Save rushijagani/c55ef3c788e86515a2298cbd06592c81 to your computer and use it in GitHub Desktop.
Save rushijagani/c55ef3c788e86515a2298cbd06592c81 to your computer and use it in GitHub Desktop.
Remove published date from Post meta from Astra
<?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