-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsidebar.php
65 lines (37 loc) · 1.65 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php if ( is_active_sidebar( 'sidebar' ) ) : ?>
<div class="sidebar right" role="complementary">
<?php dynamic_sidebar( 'sidebar' ); ?>
</div><!-- /sidebar -->
<?php else : ?>
<div class="sidebar right" role="complementary">
<div id="search" class="widget widget_search">
<div class="widget-content">
<?php get_search_form(); ?>
</div>
</div> <!-- /widget_search -->
<div class="widget widget_recent_entries">
<div class="widget-content">
<h3 class="widget-title"><?php _e("Latest posts", "hemingway") ?></h3>
<ul>
<?php
$args = array( 'numberposts' => '5', 'post_status' => 'publish' );
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent ){
echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="'.esc_attr($recent["post_title"]).'" >' . $recent["post_title"].'</a> </li> ';
}
?>
</ul>
</div>
<div class="clear"></div>
</div> <!-- /widget_recent_entries -->
<div class="widget widget_text">
<div class="widget-content">
<h3 class="widget-title"><?php _e("Text widget", "hemingway") ?></h3>
<div class="textwidget">
<p><?php _e("These widgets are displayed because you haven't added any widgets of your own yet. You can do so at Appearance > Widgets in the WordPress settings.", "hemingway") ?></p>
</div>
</div>
<div class="clear"></div>
</div> <!-- /widget_recent_entries -->
</div> <!-- /sidebar -->
<?php endif; ?>