diff --git a/src/functions/setup.php b/src/functions/setup.php index 0ec5f79..df60db5 100644 --- a/src/functions/setup.php +++ b/src/functions/setup.php @@ -23,4 +23,22 @@ if(!function_exists('tainacan_setup')) { } } -add_action( 'after_setup_theme', 'tainacan_setup' ); \ No newline at end of file +add_action( 'after_setup_theme', 'tainacan_setup' ); + +if ( ! function_exists( 'tainacan_post_date' ) ) { + function tainacan_post_date() { + if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { + $time_string = ''; + if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { + $time_string = ' '; + } + $time_string = sprintf( $time_string, + esc_attr( get_the_date( 'c' ) ), + get_the_date(), + esc_attr( get_the_modified_date( 'c' ) ), + get_the_modified_date() + ); + echo $time_string; + } + } +} \ No newline at end of file diff --git a/src/index.php b/src/index.php index 7eb1de3..87aaa1b 100644 --- a/src/index.php +++ b/src/index.php @@ -1,10 +1,10 @@