mirror of
https://github.com/danpros/htmly.git
synced 2026-04-18 03:26:20 +05:30
Cleaning blog theme
This commit is contained in:
parent
aeec0910ff
commit
489e4a8cef
2 changed files with 19 additions and 22 deletions
|
|
@ -94,15 +94,14 @@
|
|||
<div class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane active" id="recent-posts">
|
||||
<h2 class="hide"><?php echo i18n("Recent_Posts");?></h2>
|
||||
<?php $lists = recent_posts(true);?>
|
||||
<?php $char = 60;?>
|
||||
<?php foreach ($lists as $l):?>
|
||||
<?php if (strlen(strip_tags($l->title)) > $char) { $recentTitle = shorten($l->title, $char) . '...';} else {$recentTitle = $l->title;}?>
|
||||
<?php $recent = recent_posts(true);?>
|
||||
<?php foreach ($recent as $rc):?>
|
||||
<?php $recentTitle = (strlen(strip_tags($rc->title)) > 60) ? shorten($rc->title, 60) . '...' : $rc->title; ?>
|
||||
<div class="item">
|
||||
<h3 class="title"><a href="<?php echo $l->url;?>"><?php echo $recentTitle;?></a></h3>
|
||||
<h3 class="title"><a href="<?php echo $rc->url;?>"><?php echo $recentTitle;?></a></h3>
|
||||
<div class="content">
|
||||
<p><?php echo shorten($l->body, 75); ?>...</p>
|
||||
<a class="more-link" href="<?php echo $l->url;?>"><i class="fa fa-link"></i> <?php echo i18n("read_more");?></a>
|
||||
<p><?php echo shorten($rc->body, 75); ?>...</p>
|
||||
<a class="more-link" href="<?php echo $rc->url;?>"><i class="fa fa-link"></i> <?php echo i18n("read_more");?></a>
|
||||
</div><!--//content-->
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
|
|
@ -110,15 +109,14 @@
|
|||
<?php if (config('views.counter') === 'true') :?>
|
||||
<div role="tabpanel" class="tab-pane" id="popular-posts">
|
||||
<h2 class="hide"><?php echo i18n("Popular_posts");?></h2>
|
||||
<?php $lists = popular_posts(true);?>
|
||||
<?php $char = 60;?>
|
||||
<?php foreach ($lists as $l):?>
|
||||
<?php if (strlen(strip_tags($l->title)) > $char) { $recentTitle = shorten($l->title, $char) . '...';} else {$recentTitle = $l->title;}?>
|
||||
<?php $popular = popular_posts(true);?>
|
||||
<?php foreach ($popular as $pp):?>
|
||||
<?php $popularTitle = (strlen(strip_tags($pp->title)) > 60) ? shorten($pp->title, 60) . '...' : $pp->title; ?>
|
||||
<div class="item">
|
||||
<h3 class="title"><a href="<?php echo $l->url;?>"><?php echo $recentTitle;?></a></h3>
|
||||
<h3 class="title"><a href="<?php echo $pp->url;?>"><?php echo $popularTitle;?></a></h3>
|
||||
<div class="content">
|
||||
<p><?php echo shorten($l->body, 75); ?>...</p>
|
||||
<a class="more-link" href="<?php echo $l->url;?>"><i class="fa fa-link"></i> <?php echo i18n("read_more");?></a>
|
||||
<p><?php echo shorten($pp->body, 75); ?>...</p>
|
||||
<a class="more-link" href="<?php echo $pp->url;?>"><i class="fa fa-link"></i> <?php echo i18n("read_more");?></a>
|
||||
</div><!--//content-->
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
|
|
|
|||
|
|
@ -71,24 +71,23 @@
|
|||
<?php if (disqus_count()): ?>
|
||||
<?php echo disqus_count() ?>
|
||||
<?php endif; ?>
|
||||
<?php $tags = get_related($p->related, true, config('related.count'));?>
|
||||
<?php $char = 30; $total = count($tags); $i = 1; if ($total >= 1) { ?>
|
||||
<?php $related = get_related($p->related, true, config('related.count'));?>
|
||||
<?php if (!empty($related)): ?>
|
||||
<div class="related related-posts" style="margin-top:30px;position:relative;">
|
||||
<hr>
|
||||
<h2 class="heading"><?php echo i18n("Related_posts");?></h2>
|
||||
<?php foreach ($tags as $t):?>
|
||||
<?php foreach ($related as $rl):?>
|
||||
<div class="item col-md-4">
|
||||
<?php if (strlen(strip_tags($t->title)) > $char) { $relatedTitle = shorten($t->title, $char) . '...';} else {$relatedTitle = $t->title;}?>
|
||||
<h3 class="title"><a href="<?php echo $t->url;?>"><?php echo $relatedTitle;?></a></h3>
|
||||
<?php $relatedTitle = (strlen(strip_tags($rl->title)) > 30) ? shorten($rl->title, 30) . '...' : $rl->title; ?>
|
||||
<h3 class="title"><a href="<?php echo $rl->url;?>"><?php echo $relatedTitle;?></a></h3>
|
||||
<div class="content">
|
||||
<p><?php echo shorten($t->body, 60); ?>... <a class="more-link" href="<?php echo $t->url;?>"><?php echo i18n("read_more");?></a></p>
|
||||
<p><?php echo shorten($rl->body, 60); ?>... <a class="more-link" href="<?php echo $rl->url;?>"><?php echo i18n("read_more");?></a></p>
|
||||
</div><!--//content-->
|
||||
</div>
|
||||
<?php if ($i++ >= config('related.count')) break; ?>
|
||||
<?php endforeach;?>
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
<?php }?>
|
||||
<?php endif; ?>
|
||||
</div><!--//item-->
|
||||
</div><!--//content-->
|
||||
</div><!--//section-inner-->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue