-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive.php
48 lines (35 loc) · 1.18 KB
/
archive.php
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
<?php get_header(); ?>
<div class="inner_page">
<!-- 文章列表頁 -->
<div class="article_list">
<?php
// echo get_post_type( get_the_ID() )
?>
<div class="top">
<?php $obj = get_post_type_object( get_post_type( get_the_ID() ) ); ?>
<h2 class="title"><?php echo $obj->label; ?></h2>
<h4><?php echo $obj->description; ?></h4>
</div>
<!-- 文章列表 -->
<ul class="index_article" id="tab1">
<?php
$post_list = get_posts( array(
'post_type' => get_post_type( get_the_ID() ),
'orderby' => 'date',
'order' => 'DESC'
) );
foreach ( $post_list as $post ) :
?>
<li>
<a href="<?php echo get_the_permalink( $post->ID ); ?>">
<img src="<?php echo get_the_post_thumbnail_url($post->ID) ?>">
<h3><?php echo get_the_title( $post->ID ); ?></h3>
</a>
</li>
<?php
endforeach;
?>
</ul>
</div>
</div>
<?php get_footer(); ?>