Last active
June 8, 2017 14:07
-
-
Save ScarletPonytail/b3c6b3894b61a8f0d1e524dced7f032f to your computer and use it in GitHub Desktop.
WordPress - Exclude Latest Page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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