Created
July 17, 2020 18:45
-
-
Save awhite92/bab2c6d5c5f05d85e13bccf3fef5df73 to your computer and use it in GitHub Desktop.
Fix for WordPress archive pagination not working.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Fix pagination on archive pages. | |
* Change 'news' (in both places) to the archive that is having the redirect problem. | |
*/ | |
function wss_pagination_rewrite() { | |
add_rewrite_rule( 'news/page/?([0-9]{1,})/?$', 'index.php?category_name=news&paged=$matches[1]', 'top' ); | |
} | |
add_action( 'init', 'wss_pagination_rewrite' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment