-
Notifications
You must be signed in to change notification settings - Fork 0
/
category.php
executable file
·163 lines (153 loc) · 4.09 KB
/
category.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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?php
/**
* The main template suleusair category
*
* 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://codex.wordpress.org/Template_Hierarchy
*
* @package islonely
*/
get_header(); ?>
<style>
.newbg {
background-size: cover; /* 宽度拉满,保持比例 */
background-repeat: no-repeat; /* 不重复 */
background-position: center center; /* 图片居中对齐 */
}
.news-grid-content a{
display: block;
position: relative;
overflow: hidden;
color: #333333;
}
.news-grid-content a .meta {
display: block;
font-size: 16px;
text-align: center;
background-color: rgb(18 16 38);
position: absolute;
z-index: 1;
top: 0;
right: 0;
padding: 8px 16px;
}
.news-grid-content a .cover {
display: block;
position: relative;
height: 0;
width: 100%;
padding-bottom: 100%;
}
.news-grid-content a .cover img {
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
.news-grid-content a .intro {
position: absolute;
z-index: 2;
bottom: 0;
left: 0;
background-image: linear-gradient(15deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0) 80%);
width: 90%;
padding: 16px;
transition: background .4s, transform .4s;
color: #ffffff;
transform: translateY(48px);
}
.news-grid-content a .intro h3 {
font-size: 16px;
font-weight: normal;
line-height: 1.5;
transition: color .4s;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: normal;
color: #ffffff;
}
.news-grid-content a .intro span {
display: block;
width: 32px;
height: 32px;
text-align: center;
margin-left: auto;
transition: background-color .4s;
line-height: 32px;
color: #F49628;
overflow: hidden;
border-radius: 50%;
margin-top: 16px;
}
.news-grid-content a .intro h3:hover {
color: #F49628;
}
.news-grid-content a:hover .intro h3 {
color: #333333 !important;
}
.news-grid-content a .intro span {
display: block;
width: 32px;
height: 32px;
text-align: center;
margin-left: auto;
transition: background-color .4s;
line-height: 32px;
color: #F49628;
overflow: hidden;
border-radius: 50%;
margin-top: 16px;
}
.news-grid-content a .intro span:hover {
background-color: #f5f5f5;
}
.news-grid-content a:hover .intro {
background-image: none;
background-color: rgb(18 16 38) !important;
color: #333333 !important;
transform: translateY(0);
}
.news-grid-contenta:hover .intro h3 {
white-space: normal;
}
</style>
<div class="newbg uk-light uk-cover-container uk-section uk-section-xlarge" style="background-image: url('<?php echo fw_get_opt('single_page_bg');?>');">
<div class="uk-position-cover" style="background-color: rgba(30, 26, 65, 0.76);"></div>
<div class="uk-container uk-position-relative">
<div class="uk-grid tm-grid-expand uk-child-width-1-1 uk-grid-margin">
<div class="uk-section home-bg">
<div class="uk-width-1-1@m uk-text-center uk-padding">
<h1><?php single_cat_title(); ?></h1>
</div>
<div class="uk-container uk-container-xlarge">
<div class="uk-child-width-1-3@s uk-child-width-1-2 news-grid-content" uk-grid>
<?php if ( have_posts() ) : ?>
<?php
/* Start the Loop */
while ( have_posts() ) :
the_post();
get_template_part( 'Module/post/category-item');
endwhile;
else :
get_template_part( 'template/content', 'none' );
endif;
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
// Load WordPress footer
get_footer(); ?>