-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeatured-content.php
More file actions
36 lines (31 loc) · 854 Bytes
/
Copy pathfeatured-content.php
File metadata and controls
36 lines (31 loc) · 854 Bytes
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
/**
* Template for displaying the featured content hero area.
*
* Retrieves featured posts via canard_get_featured_posts() and renders each
* one using the content-featured-post template part. Returns early without
* output when no featured posts are configured. Called from index.php only
* when is_home() is true.
*
* @package Canard
*/
declare( strict_types = 1 );
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$featured_posts = canard_get_featured_posts();
if ( empty( $featured_posts ) ) {
return;
}
?>
<div id="featured-content" class="featured-content">
<div class="featured-content-inner">
<?php
foreach ( $featured_posts as $post ) {
setup_postdata( $post );
get_template_part( 'content', 'featured-post' );
}
wp_reset_postdata();
?>
</div><!-- .featured-content-inner -->
</div><!-- #featured-content -->