• Hi,

    I have a custom page with posts and pagination. Pagination links look like this: en/page_slug/page/2

    There is an 404 error on click on every pagination link.

    I tried to regenerate permalinks and reinstall Sublanguage plugin, but the error remains. Sublanguage version 2.7.1, Worpress version 5.5.3.

    Thank you!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter sergit

    (@sergit)

    I’ve found solution to this 404 error.

    Pagination links worked as expected when the Sublanguage plugin was off.
    For correct pagination that works with Sublanguage though, you need to add a rewrite rule (for your links) to functions.php. After that, regenerate your permalinks (Settings > Permalinks):

    function my_pagination_rewrite() {
        add_rewrite_rule('your-page-name/page/?([0-9]{1,})/?$', 'index.php?pagename=your-page-name&paged=$matches[1]', 'top');
    }
    add_action('init', 'my_pagination_rewrite');

    Thanks for the solution:
    Fixing a WordPress pagination 404 error
    page_slug/page/2 return 404 error

    And many thanks to Maxime for this plugin.

Viewing 1 replies (of 1 total)
  • The topic ‘pagination 404 Error’ is closed to new replies.