name || $post_type_obj->has_archive ) { // Build time string only once. $is_modified = get_the_time( 'U' ) !== get_the_modified_time( 'U' ); if ( $is_modified ) { $time_string = sprintf( '', esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); } else { $time_string = sprintf( '', esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) ); } // Add permalink only once. $time_string = '' . $time_string . ''; } // Show author only if the post type supports it. if ( post_type_supports( $post_type_obj->name, 'author' ) ) { // Get author ID once. $author_id = $post->post_author; // Get author link once. $author_url = get_author_posts_url( $author_id ); $author_name = get_the_author(); $author_string = sprintf( '', esc_url( $author_url ), esc_html( $author_name ) ); } // Show parent post only if available and if the post type is 'attachment'. if ( ! empty( $post->post_parent ) && 'attachment' === get_post_type() ) { $parent_string = sprintf( '%2$s', esc_url( get_permalink( $post->post_parent ) ), esc_html( get_the_title( $post->post_parent ) ) ); } ?>