Permalink
Browse files

Fix for some paginated URLs that get broken in some scenarios.

  • Loading branch information...
1 parent 13e882b commit 3cfde9f8caa4a74b677d521dead3e45491bbec93 @justintadlock committed Jun 5, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 extensions/loop-pagination.php
@@ -14,7 +14,7 @@
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @package LoopPagination
- * @version 0.1.4
+ * @version 0.1.5
* @author Justin Tadlock <justin@justintadlock.com>
* @copyright Copyright (c) 2010 - 2012, Justin Tadlock
* @link http://devpress.com/blog/loop-pagination-for-theme-developers
@@ -64,8 +64,9 @@ function loop_pagination( $args = array() ) {
);
/* Add the $base argument to the array if the user is using permalinks. */
- if( $wp_rewrite->using_permalinks() )
- $defaults['base'] = user_trailingslashit( trailingslashit( get_pagenum_link() ) . 'page/%#%' );
+ if ( $wp_rewrite->using_permalinks() )
+ $defaults['base'] = str_replace( 2, '%#%', esc_url( get_pagenum_link( 2 ) ) );
+ //$defaults['base'] = user_trailingslashit( trailingslashit( get_pagenum_link() ) . 'page/%#%' );
/* If we're on a search results page, we need to change this up a bit. */
if ( is_search() ) {

0 comments on commit 3cfde9f

Please sign in to comment.