/
featured-content.php
87 lines (53 loc) · 1.85 KB
/
featured-content.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
/**
* Featured Post Slider
*
*/
// Get our Featured Content posts
$featured_posts = glades_get_featured_content();
// Set loop count
$loop_count = 1;
?>
<div id="featured-content" class="clearfix">
<?php // Display Featured Content
foreach ( $featured_posts as $post ) : setup_postdata( $post );
// Display first featured post (big)
if( isset($loop_count) and $loop_count == 1 ) : ?>
<div class="featured-content-left">
<div class="featured-post-wrap clearfix">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<a href="<?php esc_url(the_permalink()) ?>" rel="bookmark">
<?php the_post_thumbnail('glades-featured-content-left'); ?>
</a>
<div class="post-content">
<h2 class="post-title"><a href="<?php esc_url(the_permalink()) ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<div class="postmeta clearfix"><?php glades_display_postmeta(); ?></div>
</div>
</article>
</div>
</div>
<div class="featured-content-right clearfix">
<?php // Display second featured post on the right side
else: ?>
<div class="featured-post-wrap clearfix">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<a href="<?php esc_url(the_permalink()) ?>" rel="bookmark">
<?php the_post_thumbnail('glades-featured-content-right'); ?>
</a>
<div class="post-content">
<h2 class="post-title"><a href="<?php esc_url(the_permalink()) ?>" rel="bookmark"><?php the_title(); ?></a></h2>
</div>
</article>
</div>
<?php
endif;
// Increase Loop count
$loop_count++;
endforeach;
?>
</div><!-- end .featured-content-right -->
</div><!-- end #featured-content -->
<?php
// Reset Postdata
wp_reset_postdata();
?>