-
Notifications
You must be signed in to change notification settings - Fork 0
/
categories.php
38 lines (33 loc) · 1.01 KB
/
categories.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
<?php
include_once("templates/header.php");
if (isset($_GET['category'])) {
$currentCategory;
foreach($categories as $category) {
if ($category['category'] == $_GET['category']) {
$currentCategory = $category;
}
}
}
?>
<main id="post-container">
<div id="content-container">
<h1 id="main-title"><?= $currentCategory['title'] ?></h1>
<div class="img-container">
<img src="<?= $BASE_URL ?>/img/<?= $currentCategory['img'] ?>" alt="<?= $currentCategory['title'] ?>" />
</div>
<p class="post-content"><?= $currentCategory['description'] ?></p>
</div>
<aside id="nav-container">
<h3 id="categories-title">Categorias</h3>
<ul id="categories-list">
<?php foreach($categories as $category) : ?>
<li>
<a class="tag" href="<?= $BASE_URL ?>categories.php?category=<?= $category['category']?>" > <?= $category['name'] ?> </a>
</li>
<?php endforeach; ?>
</ul>
</aside>
</main>
<?php
include_once("templates/footer.php")
?>