is_home()
refers to the Posts page regardless of whether it is on the front page or an inner page.
is_posts_page
refers to Posts page only when it is an inner page.
As such the if conditionals in the two code blocks at https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination#Offset_.26_Manual_Pagination should ideally be like this:
if ( ! $query->is_posts_page ) {
should be
if ( ! $query->is_home() ) {
and
if ( $query->is_posts_page ) {
should be
if ( $query->is_home() ) {
You should update the codex page!
Done.
Perfect.
When I read this post last night it had “! $query->is_main_query()” in the conditional, but they are gone now. What happened?
That was making the code offset the Posts even in other views like category archives.
Thanks for the clarification.
Feel free to delete my comments as they don’t really add to the post.