diff --git a/src/wp-includes/query.php b/src/wp-includes/query.php index 3bc0fcd4f9..1ec9566c41 100644 --- a/src/wp-includes/query.php +++ b/src/wp-includes/query.php @@ -2801,13 +2801,13 @@ class WP_Query { if ( !$page ) $page = 1; - $pgstrt = ($page - 1) * $q['posts_per_page']; - - if ( ! empty( $q['offset'] ) ) { + if ( empty($q['offset']) ) { + $pgstrt = ($page - 1) * $q['posts_per_page'] . ', '; + } else { // we're ignoring $page and using 'offset' $q['offset'] = absint($q['offset']); - $pgstrt += $q['offset']; + $pgstrt = $q['offset'] . ', '; } - $limits = 'LIMIT ' . $pgstrt . ', ' . $q['posts_per_page']; + $limits = 'LIMIT ' . $pgstrt . $q['posts_per_page']; } // Comments feeds