Created
June 7, 2013 20:53
-
-
Save mattbrett/5732351 to your computer and use it in GitHub Desktop.
WordPress: Basic Loop
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
<?php if ( have_posts() ) : ?> | |
<?php while ( have_posts() ) : the_post(); ?> | |
<?php get_template_part( 'content', 'index' ); ?> | |
<?php endwhile; ?> | |
<?php if ( function_exists('wp_pagenavi') ) : wp_pagenavi(); else : ?> | |
<!-- pagination --> | |
<div id="pagination"> | |
<div class="alignleft"><?php previous_posts_link('Previous', 0); ?></div> | |
<div class="alignright"><?php next_posts_link('Next', 0); ?></div> | |
</div> | |
<!-- /pagination --> | |
<?php endif; ?> | |
<?php else : ?> | |
<p><?php _e('Sorry, there are no posts or pages that matched your criteria. Be sure to check your spelling. If all else fails, you can <a href="javascript:history.back()">go back to the page you came from</a>, return to the <a href="' . home_url() . '">homepage</a>, or try searching.','mb'); ?></p> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment