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

    (@manishahrir)

    UPDATE:
    I was busy digging these days without any luck.
    I managed to intercept 404 error using the following code:

    function log_404_error() {
        if( is_404() )
        {
            global $wp_query;
            update_option( 'last404error', json_encode($wp_query->query) );
        }
    }
    add_action( 'template_redirect', 'log_404_error' );

    Then I read/get last404error in 404.php using URL:
    https://www.mydomain.com/en/bookstore/page/3
    404.php displays $wp_query->query parameters as follows:
    {“paged”:”3″,”post_type”:”bookstore”,”lang”:”en”}
    Any idea?

Viewing 1 replies (of 1 total)
  • The topic ‘Problem with pagination when paged=2’ is closed to new replies.