-
Notifications
You must be signed in to change notification settings - Fork 1
/
sidebar.php
36 lines (29 loc) · 857 Bytes
/
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
<?php
/**
* The sidebar containing the main widget area
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package Sunrise_National
*/
?>
<aside id="secondary" class="widget-area content-sidebar">
<h4> Featured Posts</h4>
<?php
// the query
$the_query = new WP_Query( array(
'posts_per_page' => 5,
'category_name' => 'featured'
));
?>
<?php if ( $the_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<?php get_template_part( 'template-parts/content/content-sidebar', 'sidebar' ); ?>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php else : ?>
<p><?php __('No News'); ?></p>
<?php endif; ?>
<?php //echo do_shortcode( '[display-posts image_size="thumbnail"]' ); ?>
<?php //dynamic_sidebar( 'sidebar-1' ); ?>
</aside><!-- #secondary -->