• Skip to primary navigation
  • Skip to main content

Genesis Community

Resources for Genesis WordPress Theme Users

  • Facebook
  • Twitter
  • Slack
  • Wiki
  • Login
You are here: Home / Wikis / WordPress / Show all posts on archives

Show all posts on archives

add_action( 'pre_get_posts', 'sk_show_all_entries' );
/**
 * Shows all posts on archives.
 *
 * @author Bill Erickson
 * @link http://www.billerickson.net/customize-the-wordpress-query/
 * @param object $query data.
 *
 */
function sk_show_all_entries( $query ) {
    if ( $query->is_main_query() && ! is_admin() && is_archive() ) {
        $query->set( 'posts_per_page', '-1' );
    }
}

Posted by: Sridhar Katakam Category: WordPress Tags: pre_get_posts

« Remove Visual tab in WordPress editor
Add Custom Post Type entries to Author Archives »

Copyright © 2026 · Genesis Sample on Genesis Framework · WordPress · Log in