sticky check1

This commit is contained in:
Holger Könemann 2015-08-12 13:02:59 +02:00
parent dd21aabb27
commit 027df57a2b
2 changed files with 2 additions and 7 deletions

View File

@ -15,10 +15,7 @@ get_header(); ?>
<?php get_template_part('hero'); ?> <?php get_template_part('hero'); ?>
<?php while (have_posts()) : the_post(); ?> <?php get_template_part('sticky'); ?>
<?php if (!is_sticky()) continue; ?>
<?php get_template_part('sticky'); ?>
<?php endwhile; ?>
<div class="wrapper" id="wrapper-index"> <div class="wrapper" id="wrapper-index">

View File

@ -2,8 +2,6 @@
<div class="wrapper" id="wrapper-sticky"> <div class="wrapper" id="wrapper-sticky">
<div class="container"> <div class="container">
<div class="col-md-12"> <div class="col-md-12">
<?php <?php
// Get IDs of sticky posts // Get IDs of sticky posts
$sticky = get_option('sticky_posts'); $sticky = get_option('sticky_posts');
@ -18,6 +16,7 @@
// Get only the most recent // Get only the most recent
'posts_per_page' => 1 'posts_per_page' => 1
)); ));
while ($most_recent_sticky_post->have_posts()) : $most_recent_sticky_post->the_post(); ?> while ($most_recent_sticky_post->have_posts()) : $most_recent_sticky_post->the_post(); ?>
<?php <?php
/* Include the Post-Format-specific template for the content. /* Include the Post-Format-specific template for the content.
@ -27,7 +26,6 @@
get_template_part( 'content', get_post_format() ); get_template_part( 'content', get_post_format() );
?> ?>
<?php endwhile; wp_reset_query(); ?> <?php endwhile; wp_reset_query(); ?>
</div> </div>
</div> </div>
</div> </div>