-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle.php
More file actions
38 lines (32 loc) · 1.19 KB
/
single.php
File metadata and controls
38 lines (32 loc) · 1.19 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
<?php get_header(); ?>
<?php // query_posts函数
$args = array(
// query_posts参数,具体参数可以参加官方文档
'showposts' => 1,
);
// 下面这一行代码是必须的,不然不能分页
$arms = array_merge($args, $wp_query->query);
query_posts($arms);
// 主循环
if ( have_posts() ) : while ( have_posts() ) : the_post();
?>
<div class="ui middle aligned animated list relaxed">
<div class="ui raised segment">
<h4><a href="<?php the_permalink(); ?>"><?php echo the_title(); ?></a></h4>
<div class="right floated content">
<div class="ui small" id="date">
<i class="calendar outline icon"></i><?php echo the_date(); ?>
<i class="tag icon"></i> <?php the_category(' '); ?>
</div>
</div>
<?php echo the_content(); ?>
</div>
</div>
<?php
endwhile; else:
endif;
// 重置query
wp_reset_query();
?>
<script src="<?php echo get_stylesheet_directory_uri(); ?>/js/run_prettify.js?autoload=true&skin=desert&lang=css" defer="defer"></script>
<?php get_footer(); ?>