Skip to main content
added 132 characters in body
Source Link
Milo
  • 78.8k
  • 4
  • 127
  • 168

When using pretty permalinks, the paged query var is for paginated archives, and the pretty permalink format is:

http://example.com/category/foo/page/2/

The query var on paginated single posts is page, and the pretty permalink format is:

http://example.com/post-name/2/

If you're trying to paginate a secondary loop using the current page number in a single post, you need to read the query var page, but set the query var paged.

EDIT - grabbing the current page number on a single post:

$page = 0 == get_query_var('page') ? 1 : get_query_var('page');

When using pretty permalinks, the paged query var is for paginated archives, and the pretty permalink format is:

http://example.com/category/foo/page/2/

The query var on paginated single posts is page, and the pretty permalink format is:

http://example.com/post-name/2/

If you're trying to paginate a secondary loop using the current page number in a single post, you need to read the query var page, but set the query var paged.

When using pretty permalinks, the paged query var is for paginated archives, and the pretty permalink format is:

http://example.com/category/foo/page/2/

The query var on paginated single posts is page, and the pretty permalink format is:

http://example.com/post-name/2/

If you're trying to paginate a secondary loop using the current page number in a single post, you need to read the query var page, but set the query var paged.

EDIT - grabbing the current page number on a single post:

$page = 0 == get_query_var('page') ? 1 : get_query_var('page');
Source Link
Milo
  • 78.8k
  • 4
  • 127
  • 168

When using pretty permalinks, the paged query var is for paginated archives, and the pretty permalink format is:

http://example.com/category/foo/page/2/

The query var on paginated single posts is page, and the pretty permalink format is:

http://example.com/post-name/2/

If you're trying to paginate a secondary loop using the current page number in a single post, you need to read the query var page, but set the query var paged.