<?php
get_header();?>
<?php if (is_home() && !is_front_page() && !empty(single_post_title('', false))): ?>
<header class="page-header alignwide">
<h1 class="page-title"><?php single_post_title();?></h1>
</header><!-- .page-header -->
<?php endif;?>
<?php
echo "Is sticky post";
echo "<br/>";
$sticky = get_option('sticky_posts');
if (!empty($sticky)) {
$args = array(
'posts_per_page' => -1, //get all post
'post__in' => $sticky, //are they sticky post
);
// The Query
$the_query = new WP_Query($args);
while ($the_query->have_posts()) {
$the_query->the_post();
echo '<div>' . get_the_title() . '</div>';
echo "<br/>";
}
wp_reset_query(); //reset the original WP_Query
}
echo "<br/>";
echo "Now get the not sticky post";
echo "<br/>";
$args2 = array(
'posts_per_page' => -1, //get all post
'post__not_in' => $sticky, //are they NOT sticky post
);
// The Query
$the_query2 = new WP_Query($args2);
while ($the_query2->have_posts()) {
$the_query2->the_post();
echo '<div>' . get_the_title() . '</div>';
echo "<br/>";
}
wp_reset_query(); //reset the original WP_Query
get_footer();
?>