forked from moobaer/tiga
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent-featured.php
More file actions
68 lines (49 loc) · 1.71 KB
/
content-featured.php
File metadata and controls
68 lines (49 loc) · 1.71 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
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
<?php
/**
* Featured posts
*
* Display featured posts based on sticky post
*
* @package Tiga
* @author Satrya
* @license license.txt
* @since 1.0
*
*/
$sticky = get_option( 'sticky_posts' );
if ( ! empty( $sticky ) ) { ?>
<section class="featured-posts rslides_container">
<div class="featuredposts-heading"><?php _e( 'Featured Posts', 'tiga' ); ?></div>
<ul class="rslides clearfix">
<?php
$args = array(
'post__in' => $sticky,
'order' => 'DESC'
);
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) : ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<li>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'featured-slides' ); ?>>
<div class="slides-item">
<?php if( has_post_thumbnail() ) { ?>
<figure class="slides-thumbnail">
<?php the_post_thumbnail( 'tiga-700px', array( 'class' => 'photo thumbnail', 'alt' => get_the_title() ) ); ?>
</figure>
<?php } ?>
<div class="slides-content">
<h2 class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tiga' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
</h2>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div>
</div> <!-- end slides-content -->
</div> <!-- end .slides-item -->
</article> <!-- end #post-<?php the_ID(); ?> -->
</li>
<?php endwhile; wp_reset_postdata();?>
<?php endif; ?>
</ul> <!-- end .slides -->
</section> <!-- end .featured-posts -->
<?php } ?>