thanh25896
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [GeneratePress] Modifier info below post titleAdded and it is become
Updated Date | Published date | Author | Comment |I added this script into php and
add_shortcode( 'comment_number', 'tu_comment_number_sc' ); function tu_comment_number_sc() { ob_start(); comments_popup_link( __( '0 Comment', 'generatepress' ), __( '1 Comment', 'generatepress' ), __( '% Comments', 'generatepress' ) ); return ob_get_clean(); } add_filter( 'generate_post_date_output', 'tu_show_modified_date' ); function tu_show_modified_date() { printf( '<span class="posted-on-published"> %1$s %3$s </span>', esc_html( get_the_date() ), esc_attr( get_the_time() ), get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ? '<span class="posted-on-updated"> </span> ' . esc_html( get_the_modified_date() ) : '' ); #echo '<span class="view-post"><i class="fa fa-eye fa-1x " aria-hidden="true"></i></span> ' . do_shortcode( '[views] ' ); echo '<i class="fad fa-comments" aria-hidden="true"></i><span class="comment-post"> ' . do_shortcode( '[comment_number] </span>' ); }
And it become Published date | updated date | Comment Count |like
https://imgur.com/a/7CK7i7t in home page and single postpage with Addition CSSIt is ok in home page but I want in single post page it become Published date | updated date | (icon) Author name (without link) | Comment Count | like https://imgur.com/a/SySGLKh
Is the code I added above is optimize? If not anyway to optimize that?
I want