• Hi,

    Hopefully someone can help me get to the bottom of some rather strange 404 behaviour.

    I’ve got a site which is currently in development … https://www.967atc.co.uk/wordpress/

    My php / html coding isn’t exactly the cleanest you may have ever come across (it grows very organically!), but up until now it seems to have worked quite well.

    My problem is that I get random ‘positives’ on is_404() when using pagination links. For instance here…

    https://www.967atc.co.uk/wordpress/category/activities/page/3/

    Page 2 and 1 work fine, but as soon as you go to page 4 it gives the 404.

    The site runs two loops, the first checks if you’re is_category(), is_404, is_home(), is_search() etc and displays a single pane with relevent content. The second loop runs the ‘real’ query and displays the resulting output. It appears that the first query is getting a True on is_404() and as such displaying my 404 pane (‘Negative Ghostrider…’).

    I have no idea where to start with debugging this, can anyone give me any pointers?

    Thanks

    Jamie

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter wright_jamie

    (@wright_jamie)

    Well, after a little bit of playing, I managed to half fix this by changing the posts per page in the Reading pane of the dashboard. I set it to 4 and it fixes things.

    My guess is that the is_404 is not set against my updated ‘posts per page’ in my query. Interesting stuff.

    Anyhow, I’ve set the Reading pane back to 10 so if anyone wants to see this behaviour in action then visit the links above. Once I make my site live, I’ll have to set it back to 4.

    The site runs two loops, the first checks if you’re is_category(), is_404, is_home(), is_search() etc and displays a single pane with relevent content. The second loop runs the ‘real’ query

    Have you set up the two Loops/queries correctly?

    https://codex.www.ads-software.com/The_Loop#Multiple_Loops
    https://codex.www.ads-software.com/Function_Reference/WP_Query

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Strange 404 behaviour’ is closed to new replies.