Chào các bác. Hiện tại em đăng bài trên fs chỉ thấy ngày đăng. Giờ em muốn thêm ngày cập nhật bài viết thì có bài hướng dẫn nào chuẩn cho fs không ạ?
Em đã thử các code share nhưng không hiển thị hoặc bị lỗi

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
if ( ! function_exists( 'flatsome_posted_on' ) ) : function flatsome_posted_on() { $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time> - Cập nhật <time class="updated" style="display: inline-block" datetime="%3$s">%4$s</time>'; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); $posted_on = sprintf( esc_html_x( 'Đăng ngày %s', 'post date', 'flatsome' ), $time_string ); $byline = sprintf( esc_html_x( 'bởi %s', 'post author', 'flatsome' ), '<span class="meta-author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>' ); echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'; } endif; |
Dán đoạn code này vào file functions.php của theme, trước trả tiền cafe cho bác toản code này giờ share lại cho b