mirror of
https://github.com/danpros/htmly.git
synced 2026-04-19 20:16:22 +05:30
Merge pull request #96 from Kanti/master
Add recent posts widget by @Kanti and @fahmi182.
This commit is contained in:
commit
6f45bbb519
5 changed files with 31 additions and 2 deletions
|
|
@ -626,6 +626,21 @@ function keyword_count($keyword) {
|
|||
return count($tmp);
|
||||
}
|
||||
|
||||
function recent() {
|
||||
$str = '<ul>';
|
||||
$posts = get_posts(null, 1, 5);
|
||||
foreach($posts as $post)
|
||||
{
|
||||
$str .= '<li><a href="' . $post->url . '">' . $post->title . '</a></li>';
|
||||
}
|
||||
if(empty($posts))
|
||||
{
|
||||
$str .= '<li>No Posts Found</li>';
|
||||
}
|
||||
$str .= '</ul>';
|
||||
return $str;
|
||||
}
|
||||
|
||||
// Return an archive list, categorized by year and month.
|
||||
function archive_list() {
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
</div>
|
||||
<div class="social"><?php echo social() ?></div>
|
||||
<div class="menu"><?php echo menu() ?></div>
|
||||
<div class="recent"><h3>Recent Posts</h3><?php echo recent() ?></div>
|
||||
<div class="archive"><?php echo archive_list()?></div>
|
||||
<div class="tagcloud"><?php echo tag_cloud()?></div>
|
||||
<div class="copyright"><?php echo copyright() ?></div>
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@
|
|||
<div class="container">
|
||||
<footer id="footer">
|
||||
<div class="footer-column">
|
||||
<div class="recent column"><div class="inner"><h3>Recent Posts</h3><?php echo recent()?></div></div>
|
||||
<div class="archive column"><div class="inner"><?php echo archive_list()?></div></div>
|
||||
<div class="tagcloud column"><div class="inner"><?php echo tag_cloud()?></div></div>
|
||||
<div class="social column"><div class="inner"><h3>Follow</h3><?php echo social()?></div></div>
|
||||
|
|
|
|||
|
|
@ -582,8 +582,16 @@ ul li, ol li{
|
|||
margin:0;
|
||||
}
|
||||
|
||||
.about, .social, .archive, .comments, .tagcloud {
|
||||
margin-bottom:2em;
|
||||
.about, .social, .archive, .comments, .tagcloud, .recent {
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
|
||||
.recent li:before {
|
||||
content: "►";
|
||||
font-size: 12px;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
margin-right: 5px;
|
||||
color: #21759B;
|
||||
}
|
||||
|
||||
/*-------------------------
|
||||
|
|
|
|||
|
|
@ -49,6 +49,10 @@
|
|||
<h3>Follow</h3>
|
||||
<?php echo social() ?>
|
||||
</div>
|
||||
<div class="recent">
|
||||
<h3>Recent Posts</h3>
|
||||
<?php echo recent() ?>
|
||||
</div>
|
||||
<div class="archive">
|
||||
<?php echo archive_list()?>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue