Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Original code:
- -----------------------------------------------------------
- $output .= '<span class="post-updated"> ' . $modified_on . '</span>';
- Corrected code:
- -----------------------------------------------------------
- $output .= '<span class="post-updated" itemprop="dateModified"> ' . $modified_on . '</span>';
- Complete 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' );
Add Comment
Please, Sign In to add comment