ildi-wp/home-loop.php

28 lines
648 B
PHP
Raw Normal View History

2018-07-24 08:20:35 -05:00
<div class="grid xs-col-100 sm-col-50 md-col-33 grid-gutter-lg">
<?php
2018-07-26 21:36:17 -05:00
$sticky = get_option( 'sticky_posts' );
$args = array(
'posts_per_page' => 10,
'post__in' => $sticky,
'ignore_sticky_posts' => 1
);
$query = new WP_Query( $args );
if ( isset($sticky[0]) && $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post(); ?>
2018-07-24 08:20:35 -05:00
<section class="home-loop">
<a href="<?php echo get_page_link(); ?>"><?php
the_title( '<h1>', '</h1>' );
the_post_thumbnail();
// the_excerpt();
?></a>
</section>
<?php }
}
2018-07-26 21:36:17 -05:00
wp_reset_postdata();
2018-07-24 08:20:35 -05:00
?>
</div>