Repository navigation
Expand file tree
/
Copy pathindex.php
More file actions
116 lines (102 loc) · 5.43 KB
/
Copy pathindex.php
File metadata and controls
116 lines (102 loc) · 5.43 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since Twenty Seventeen 1.0
* @version 1.0
*/
get_header(); ?>
<div class="cd-section" id="blogs">
<div class="blogs-1" id="blogs-1">
<div class="container">
<div class="row">
<div class="col-md-10 ml-auto mr-auto">
<h2 class="title">Latest Blogposts</h2>
<br>
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'ignore_sticky_posts' => 1,
'paged' => $paged
);
query_posts($args);
$i = 3;
?>
<div class="jubenlists">
<?php
while ( have_posts() ) : the_post();
if($i % 2 == 1){
?>
<div class="card card-plain card-blog">
<div class="row">
<div class="col-md-5">
<div class="card-image">
<img class="img img-raised rounded" data-cfsrc="https://demos.creative-tim.com/marketplace/now-ui-kit-pro/assets/img/examples/card-blog4.jpg" src="https://demos.creative-tim.com/marketplace/now-ui-kit-pro/assets/img/examples/card-blog4.jpg">
</div>
</div>
<div class="col-md-7">
<h6 class="category text-info"><?php the_tags();?></h6>
<h3 class="card-title">
<a href="<?php esc_url(the_permalink()); ?>"><?php the_title();?></a>
</h3>
<p class="card-description">
<?php echo wp_trim_words(get_the_excerpt(), 100);?><a href="<?php esc_url(the_permalink()); ?>"> Read More </a>
</p>
<p class="author">
by <a href="#pablo"><b><?php the_author();?></b></a>, 发布于<?php echo human_time_diff(get_the_time('U'), current_time('timestamp'));
_e('前','jasmine'); ?>
</p></div>
</div>
</div>
<?php
}else{
?>
<div class="card card-plain card-blog">
<div class="row">
<div class="col-md-7">
<h6 class="category text-danger">
<?php the_tags();?>
</h6>
<h3 class="card-title">
<a href="<?php esc_url(the_permalink()); ?>"><?php the_title();?></a>
</h3>
<p class="card-description">
<?php echo wp_trim_words(get_the_excerpt(), 100);?><a href="<?php esc_url(the_permalink()); ?>"> Read More </a>
</p>
<p class="author">
by <a href="#pablo"><b><?php the_author();?></b></a>, 发布于<?php echo human_time_diff(get_the_time('U'), current_time('timestamp'));
_e('前','jasmine'); ?>
</p></div>
<div class="col-md-5">
<div class="card-image">
<img class="img img-raised rounded" data-cfsrc="https://demos.creative-tim.com/marketplace/now-ui-kit-pro/assets/img/examples/card-blog6.jpg" src="https://demos.creative-tim.com/marketplace/now-ui-kit-pro/assets/img/examples/card-blog6.jpg">
</div>
</div>
</div>
</div>
<?php
}
$i++;
endwhile; wp_reset_query();
?>
</div>
<?php
$next_page = custom_get_next_posts_link('加载更多');
if($next_page) echo ''.$next_page.'';
?>
</div>
</div>
</div>
</div>
</div>
<?php
get_footer();