-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive.php
More file actions
executable file
·62 lines (56 loc) · 2.03 KB
/
archive.php
File metadata and controls
executable file
·62 lines (56 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
* The template for displaying archive pages
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package __RT
* @subpackage RT_Theme
* @since 1.0
* @version 1.0
*/
get_header();
$current_cat_id = get_query_var('cat');
?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php do_action('rt_before_main'); ?>
<div class="arc-news">
<h1 class="heading"><?php echo get_cat_name( $current_cat_id );?></h1>
<div class="new-list">
<?php
$arg = array(
'post_type' => 'post',
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'id',
'terms' => $current_cat_id
)
),
'paged'=> get_query_var('paged'),
);
$news_post = new WP_Query($arg);
while($news_post -> have_posts()) :
$news_post -> the_post();
?>
<div class="news-post">
<h2 class="title"><a href="<?php the_permalink();?>" title="<?php the_title();?>"><?php echo the_title();?></a></h2>
<a href="<?php the_permalink();?>" title="<?php the_title();?>">
<?php if(has_post_thumbnail()) the_post_thumbnail("medium",array("alt" => get_the_title()));
else echo ""; ?>
</a>
<?php the_content_limit('400','Đọc Thêm');?>
</div>
<?php
endwhile;
if(function_exists('wp_pagenavi')) {wp_pagenavi( array( 'query' => $news_post ) );}
wp_reset_postdata();
?>
</div>
</div><!--End #news-wrap-->
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_sidebar();
get_footer();