Add category

Add category feature to the core.
This commit is contained in:
Danang Probo Sayekti 2015-08-26 10:44:25 +07:00
commit a4b6fe18db
26 changed files with 1282 additions and 159 deletions

View file

@ -1,6 +1,20 @@
<?php if (!empty($breadcrumb)): ?>
<div class="breadcrumb"><?php echo $breadcrumb ?></div>
<?php endif; ?>
<?php if (!empty($category)): ?>
<div class="section">
<div class="section-inner">
<div class="content">
<div class="item">
<h2 class="title"><?php echo $category->title;?></h2>
<div class="text-left">
<?php echo $category->body; ?>
</div><!--//desc-->
</div><!--//item-->
</div><!--//content-->
</div>
</div>
<?php endif; ?>
<?php $i = 0; $len = count($posts); ?>
<?php foreach ($posts as $p): ?>
<?php if ($i == 0) {
@ -44,7 +58,7 @@
<h2 class="title" itemprop="headline"><a href="<?php echo $p->url;?>"><?php echo $p->title;?></a></h2>
<p class="meta">
<span class="date" itemprop="datePublished"><?php echo date('d F Y', $p->date) ?></span> - Posted in
<span itemprop="articleSection"><?php echo $p->tag;?></span> by
<span itemprop="articleSection"><?php echo $p->category;?></span> by
<span itemprop="author"><a href="<?php echo $p->authorUrl;?>"><?php echo $p->author;?></a></span>
<?php if (disqus_count()) { ?>
with <span><i class="fa fa-comments"></i> <a href="<?php echo $p->url ?>#disqus_thread"> comments</a></span>

View file

@ -35,7 +35,7 @@
<h1 class="title" itemprop="headline"><?php echo $p->title;?></h1>
<p class="meta">
<span class="date" itemprop="datePublished"><?php echo date('d F Y', $p->date) ?></span> - Posted in
<span itemprop="articleSection"><?php echo $p->tag;?></span> by
<span itemprop="articleSection"><?php echo $p->category;?></span> by
<span itemprop="author"><a href="<?php echo $p->authorUrl;?>"><?php echo $p->author;?></a></span>
</p>
</div>
@ -43,6 +43,7 @@
<?php echo $p->body; ?>
</div><!--//desc-->
<div style="margin-top:30px;position:relative;">
<span class="tags"><i class="fa fa-tags"></i> <?php echo $p->tag;?></span>
<?php if (disqus_count()) { ?>
<span><i class="fa fa-comments"></i> <a href="<?php echo $p->url ?>#disqus_thread"> comments</a></span>
<?php } elseif (facebook()) { ?>
@ -71,7 +72,7 @@
<?php if (disqus_count()): ?>
<?php echo disqus_count() ?>
<?php endif; ?>
<?php $tags = get_related($p->tag, true, config('related.count'));?>
<?php $tags = get_related($p->related, true, config('related.count'));?>
<?php $char = 30; $total = count($tags); $i = 1; if ($total >= 1) { ?>
<div class="related related-posts" style="margin-top:30px;position:relative;">
<hr>

View file

@ -24,7 +24,7 @@
$i++; ?>
<li class="<?php echo $class; ?>">
<span><a href="<?php echo $p->url ?>"><?php echo $p->title ?></a></span> on
<span><?php echo date('d F Y', $p->date) ?></span> - Posted in <span><?php echo $p->tag ?></span>
<span><?php echo date('d F Y', $p->date) ?></span> - Posted in <span><?php echo $p->category ?></span>
</li>
<?php endforeach; ?>
</ul>

View file

@ -60,7 +60,7 @@
</div>
<div class="related">
<h4>Related posts</h4>
<?php echo get_related($p->tag)?>
<?php echo get_related($p->related)?>
</div>
<div id="comments" class="comments border">
<?php if (facebook()): ?>

View file

@ -57,7 +57,7 @@
</div>
<div class="related">
<h4>Related posts</h4>
<?php echo get_related($p->tag)?>
<?php echo get_related($p->related)?>
</div>
<div id="comments" class="comments border">
<?php if (facebook()): ?>

View file

@ -60,7 +60,7 @@
</div>
<div class="related">
<h4>Related posts</h4>
<?php echo get_related($p->tag)?>
<?php echo get_related($p->related)?>
</div>
<div id="comments" class="comments border">
<?php if (facebook()): ?>