Advertisement
Guest User

front-page.php

a guest
Jun 3rd, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1.  
  2. // Based on https://gist.github.com/billerickson/3218052
  3. global $post;
  4. // arguments, adjust as needed
  5. $args = array(
  6. 'post_type' => 'post',
  7. 'posts_per_page' => get_option( 'posts_per_page' ),
  8. 'post_status' => 'publish',
  9. 'paged' => get_query_var( 'paged' )
  10. );
  11.  
  12. /*
  13. Overwrite $wp_query with our new query.
  14. The only reason we're doing this is so the pagination functions work,
  15. since they use $wp_query. If pagination wasn't an issue,
  16. use: https://gist.github.com/3218106
  17. */
  18.  
  19. global $wp_query;
  20. $wp_query = new WP_Query( $args );
  21.  
  22. if ( have_posts() ) :
  23. while ( have_posts() ) : the_post();
  24. endwhile;
  25.  
  26. do_action( 'genesis_after_endwhile' );
  27. endif;
  28.  
  29. wp_reset_query();
  30. }
  31. genesis();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement