Skip to content

Commit 5f67ff5

Browse files
committed
handing no local news
1 parent 894a9b4 commit 5f67ff5

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

assets/less/blog.less

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
.blog {
2-
article {
3-
h2 {
4-
font-size: 20px;
5-
margin-bottom: 0;
2+
.news {
3+
.local, .remote {
4+
.make-md-column(6);
5+
6+
article {
7+
h2 {
8+
font-size: 20px;
9+
margin-bottom: 0;
10+
}
11+
h4 {
12+
margin-top: 0;
13+
}
14+
}
615
}
7-
h4 {
8-
margin-top: 0;
16+
&.no-local {
17+
.local {
18+
display: none;
19+
}
20+
.remote {
21+
.make-md-column(12);
22+
}
923
}
1024
}
1125
}

home.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
<h2>News</h2>
1616
</div>
1717

18-
<div class="row">
18+
<div class="news <?php if (empty($localNews)) { echo 'no-local'; } ?>">
1919

20-
<div class="col-md-6">
20+
<div class="local">
2121
<h2>Local News</h2>
2222
<?php foreach ($localNews as $item): ?>
2323
<article>
@@ -34,7 +34,7 @@
3434
<?php endforeach; ?>
3535
</div>
3636

37-
<div class="col-md-6">
37+
<div class="remote">
3838
<h2>Campaign News</h2>
3939
<?php foreach ($remoteNews as $item): ?>
4040
<article>

0 commit comments

Comments
 (0)