Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $temp = $wp_query;
- $wp_query= null;
- $wp_query = new WP_Query();
- $wp_query = new WP_Query( array(
- 'post_type' => 'posts',
- 'category' => 'your category'
- 'posts_per_page'=> 10,
- 'orderby'=> 'menu_order', //this comes in handy later!
- 'order'=> 'ASC',
- 'paged'=>$paged,
- ));?>
- <?php while ($wp_query->have_posts()) : $wp_query->the_post();?>
- <div class="entry"> <!--or whatever div you want your posts to go in -->
- <?php $postNum = $post->menu_order + 1; if ($postNum < 31) : ?>
- <!--back to the post-->
- <?php else : wp_reset_query(); ?> <!--This is what stops the query after the 30th post!-->
- <?php ; endif; ?>
- </div>
- <?php endwhile;?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement