Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- có bài viết
- <?php if(have_posts()):?>
- <?php while ( have_posts() ) : the_post(); ?>
- <!--Nội dung bài viết muốn hiển thị-->
- <?php endwhile; ?>
- <?php else:?>
- <!--Thông báo khi không có bài viết nào-->
- <?php endif;?>
- Hiển thị tiêu đề :
- <?php the_title();?>
- Hiển thị tên tác giả:
- //Bao gồm link đến tác giả
- <?php the_author_posts_link(); ?>
- //Không có link đến tác giả
- <?php the_author(); ?>
- Hiển thị ngày tháng:
- //Chỉ hiển thị ngày tháng
- <?php echo get_the_date();?>
- //Hiển thị ngày tháng thêm link
- $archive_year = get_the_time('Y');
- $archive_month = get_the_time('m');
- $archive_day = get_the_time('d');
- <a href="<?php echo get_day_link( $archive_year, $archive_month, $archive_day); ?>" title="Bài viết trong ngày <?php echo $archive_day."/".$archive_month."/".$archive_year;?>"><?php echo get_the_date();?></a>
- Hiển thị lượt xem bài viết (xem thêm đếm lượt xem bài viết không cần plugin)
- <?php echo getPostViews(get_the_ID()); ?>
- Hiện thị số lượt bình luận
- //bao gồm link tới comments
- <?php comments_popup_link( '<span class="leave-reply">' . __( '0 Bình luận', '' ) . '</span>', __( '1 Comment', '' ), __( '% bình luận', '' ) ); ?>
- //Chỉ đếm số comments
- <?php comments_number( '0', '1', '%' ); ?>
- Hiển thị categories của bài viết
- //Cách nhau dấu ,
- <?php the_category(', ');?>
- Link tới bài viết
- <?php the_permalink();?>
- Hiển thị excerpt hoặc mô tả ngắn kiểu rss (chỉ text đơn thuần)
- <?php the_excerpt_rss();?>
Add Comment
Please, Sign In to add comment