Skip to content

Instantly share code, notes, and snippets.

@ScarletPonytail
Last active June 8, 2017 14:07
Show Gist options
  • Save ScarletPonytail/b3c6b3894b61a8f0d1e524dced7f032f to your computer and use it in GitHub Desktop.
Save ScarletPonytail/b3c6b3894b61a8f0d1e524dced7f032f to your computer and use it in GitHub Desktop.
WordPress - Exclude Latest Page
<!-- Latest Post -->
<div class="row latest-post">
<?php query_posts('showposts=1'); ?>
<?php
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
?>
<div class="col-md-6 news">
<?php echo get_the_post_thumbnail(); ?>
<h3><?php the_title(); ?></h3>
<?php the_excerpt(__('(more…)')); ?>
</div>
<?php
endwhile;
endif;
?>
<!-- 2nd / 3rd Posts -->
<div class="col-md-6 news older-posts">
<?php query_posts('showposts=2&offset=1'); ?>
<?php
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
?>
<div class="row mb-lg">
<div class="col-md-4">
<?php echo get_the_post_thumbnail(); ?>
</div>
<div class="col-md-8">
<h3><?php the_title(); ?></h3>
<?php the_excerpt(__('(more…)')); ?>
</div>
</div>
<?php
endwhile;
endif;
?>
</div>
</div>
// Latest Post
<?php query_posts('showposts=1'); ?>
// Next two newest posts
<?php query_posts('showposts=2&offset=1'); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment