Skip to content

Instantly share code, notes, and snippets.

@wpsmith
Forked from billerickson/gist:1238202
Last active December 15, 2015 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpsmith/5177901 to your computer and use it in GitHub Desktop.
Save wpsmith/5177901 to your computer and use it in GitHub Desktop.
<?php
add_action( 'pre_get_posts', 'smythe_no_paging' );
/**
* Remove pagination from all archive pages
*
* @author Travis Smith
* @author Bill Erickson
* @link http://www.billerickson.net/customize-the-wordpress-query/
* @param object $query data
*
*/
function smythe_no_paging( $query ) {
if( $query->is_main_query() && $query->is_archive() ) {
$query->set( 'nopaging', true );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment