-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsidebar.php
More file actions
43 lines (38 loc) · 1.04 KB
/
Copy pathsidebar.php
File metadata and controls
43 lines (38 loc) · 1.04 KB
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
<?php
/**
* The template for the sidebar containing the main widget area
*
* @package WordPress
* @subpackage Twenty_Sixteen
* @since Twenty Sixteen 1.0
*/
?>
<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
<aside id="secondary" class="sidebar widget-area" role="complementary">
<section class="widget">
<h2 class="widget-title">おすすめ記事</h2>
<?php
$args = array( 'include' => '972,1107,545,559', 'orderby' => 'post__in' );
$postslist = get_posts( $args );
foreach ( $postslist as $post ) :
setup_postdata( $post );
the_thumbnailed_article();
endforeach;
wp_reset_postdata();
?>
</section>
<section class="widget">
<h2 class="widget-title">最新記事</h2>
<?php
$args = array( 'posts_per_page' => 5 );
$postslist = get_posts( $args );
foreach ( $postslist as $post ) :
setup_postdata( $post );
the_thumbnailed_article();
endforeach;
wp_reset_postdata();
?>
</section>
<?php dynamic_sidebar( 'sidebar-1' ); ?>
</aside><!-- .sidebar .widget-area -->
<?php endif; ?>