-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsidebar-post.php
48 lines (39 loc) · 1.4 KB
/
sidebar-post.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
39
40
41
42
43
44
45
46
47
48
<?php
/**
* The Sidebar containing the main widget areas.
*/
?>
<div id="sidebar" class="widget-area col300" role="complementary">
<?php if ( ! dynamic_sidebar( 'sidebar-post' ) ) : ?>
<aside id="recent-posts" class="widget">
<div class="widget-title"><?php _e( 'Latest Posts', 'attorney' ); ?></div>
<ul>
<?php
$args = array( 'numberposts' => '10' );
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent ){
if ($recent["post_title"] == '') {
$recent["post_title"] = __('View Post', 'attorney');
}
echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >' . $recent["post_title"] .'</a> </li> ';
}
?>
</ul>
</aside>
<aside id="categories" class="widget">
<div class="widget-title"><?php _e( 'Categories', 'attorney' ); ?></div>
<ul>
<?php wp_list_categories( array(
'title_li' => '',
'hierarchical' => 0
) ); ?>
</ul>
</aside>
<aside id="archives" class="widget">
<div class="widget-title"><?php _e( 'Archives', 'attorney' ); ?></div>
<ul>
<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
</ul>
</aside>
<?php endif; // end sidebar widget area ?>
</div><!-- #sidebar .widget-area -->