lacee1986
8/9/2016 - 2:09 PM

Wordpress loop

Wordpress loop

<!-- Set the default Wordpress Pagination (Settings - Reading) to a smaller number than this -->
<?php $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; ?>
<?php $the_query = new WP_Query(array('post_type' => 'post', 'posts_per_page' => '1', 'post_status' => 'publish', 'order' => 'ASC', 'orderby' => 'menu_order',  'paged' => $paged)); ?>
<?php if ( $the_query->have_posts() ) : ?>
  <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
    <!-- Insert content here -->
  <?php endwhile; ?>
    <!-- Pagination -->
    <?php pagination(); ?>
    <?php wp_reset_postdata(); ?>
<?php else : ?>
    <!-- If no posts -->
<?php endif; ?>
<?php wp_reset_query(); ?>