• I’m working in a translation plugin for WordPress however it seems impossible to fix the bug with the home with an static page.

    If you add a parameter with query_vars and have an static home page, as soon as you use that new param the home url doesn’t work and shows latest blog entries.
    This bug is being around from forever, it hasn’t being fixed yet.

    In WordPress 4.4 I could somehow “hack” my way in parsing the url to retrieve the parameter and delete the query variable.
    However this doesn’t work anymore in WordPress 4.5. It redirects me to the homepage instead and delete the pretty url.
    Or it redirect to the latest entries instead the static page if you keep the new param.

    Is there any way to achieve what this?

    Example: you add a new query_var foo with all the redirects.
    When you access to
    Mysite.com/foo -> it will show the latest entries instead the static webpage.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You can disable the home page redirect that blanks everything after the domain by returning false in a callback to the ‘redirect_canonical’ filter. The callback should verify that static front page is enabled and the request is actually for the front page before returning false. Not tested on 4.5, I hope it helps anyway.

Viewing 1 replies (of 1 total)
  • The topic ‘How to use wp_rewrite with static page?’ is closed to new replies.