%2$s'; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = ''; } $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( ' %s', 'post date', 'flatsome' ), '' . $time_string . '' ); $byline = sprintf( esc_html_x( ' %s', 'post author', 'flatsome' ), '' . esc_html( get_the_author() ) . '' ); echo '
'.$byline.' | ' . $posted_on . ' | Leave a comment | '.getPostViews(get_the_ID()).'
'; } // hook vào product //add_action( 'woocommerce_product_meta_start','codfe_show_post_view' ); //add_action('flatsome_product_box_after','codfe_show_post_view'); function codfe_show_post_view(){ //echo current_filter().'
'; if( current_user_can('administrator') ) { echo '
'.getPostViews(get_the_ID()).'
'; } } add_shortcode("codfe-show-post-views","codfe_show_post_view");