Created
October 29, 2014 23:46
-
-
Save Clorith/92ed18ec3f447558047b to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
// This is your functions.php | |
function exclude_first_five_posts_home( $query ) { | |
if ( $query->is_home() && $query->is_main_query() ) { | |
$query->set( 'offset', '5' ); | |
} | |
} | |
add_action( 'pre_get_posts', 'exclude_first_five_posts_home' ); | |
// This is theloop.php | |
if ( have_posts() ) { | |
while ( have_posts() ) { | |
the_post(); | |
?> | |
<div class='one-post'> | |
<div id="post-<?php the_ID(); ?>" <?php post_class("post-caption"); ?>> | |
INSERT STUFF HERE | |
</div> | |
</div> | |
<?php | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment