-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsidebar.php
35 lines (32 loc) · 1.04 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
<?php
$args = array( 'number' => '12', 'orderby' => 'count', 'order' => 'desc' );
$tags_array = get_tags( $args ); ?>
<div id="sidebar">
<h2 class="sidebar_title">Popular Tags</h2>
<ul class="tags_area">
<?php
foreach ( $tags_array as $tag ) {
$tag_link = get_tag_link( $tag->term_id );
echo "<li class='tag anim'><a href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug}'>";
echo "{$tag->name}</a></li>";
}
?>
</ul>
<hr />
<?php
$args = array( 'numberposts' => '5', 'post_status' => array('publish') );
$popular_posts = wp_get_recent_posts($args);
?>
<h2 class="sidebar_title">Popular Articles</h2>
<ul id="popular_articles_area">
<?php
foreach( $popular_posts as $post ){
echo '<a href="' . get_permalink($post["ID"]) . '">';
echo '<li class="article anim"><span class="article_title">';
echo $post["post_title"].'</span><span class="article_desc">';
echo 'Posted on ' . get_the_time('F jS, Y', $post["ID"]) . ' by ' . get_the_author_meta('user_login', $post["post_author"]) . '';
echo '</span></li></a>';
}
?>
</ul>
</div>