-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsidebar.php
executable file
·47 lines (45 loc) · 1.94 KB
/
sidebar.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<div class="col-lg-4">
<div class="blog_right_sidebar">
<aside class="single_sidebar_widget post_category_widget">
<h4 class="widget_title">Category</h4>
<ul class="list cat-list">
<?php
$categories = get_category_list();
foreach($categories as $category) {
echo '<li>
<a href="/category/'.$category["id"].'/'.preg_replace('/\s+/', '-', $category['name']).'" class="d-flex">
<p>' . $category['name'] . '</p>
<p>(' . get_project_count($category["id"]) . ')</p>
</a>
</li>';
}
?>
</ul>
</aside>
<aside class="single_sidebar_widget popular_post_widget">
<h3 class="widget_title">Recent Post</h3>
<?php
$projects = get_recent_projects();
foreach($projects as $project){
$id = $project['project_id'];
$title = preg_replace('/\s+/', '-', $project['title']);
$url = "/project/" . $id . "/" . $title;
echo '
<div class="media post_item">
<img src="' . $project['thumbnail'] . '" alt="post" height=100 width=150>
<div class="media-body">
<a href='.$url.'>
<h3>' . $project['title'] . '</h3>
</a>
<p>' . $project['created_at'] . '</p>
</div>
</div>';
}
?>
</div>
</div>
</div>
</div>
</section>