• Ced

    (@cedriccharles)


    I have a weird issue on a WordPress website (Multisite). Occasionally, pages that should be using a custom template or a WP template (like archive.php) start using index.php instead. When this happens, “if (have_posts())” additionally returns false, even though the page (and its contents) do exist. I have to go into the permalinks settings and simply save them (without even changing them). The problem comes back randomly but quickly enough (a few hours)…

    Originally, the multisite used WPML for multi-language. The problem started just after the switch from WPML to Polylang (with the “WPML to Polylang” plugin).

    Here is the structure of my multisite:

    Main site (4 languages):

    Site 2 (4 languages):

    Site 3 (1 language):

    The problem occurs almost exclusively on site 3. I have installed the “Query Monitor” plugin. When the problem appears on the news listing for example (/actualites), I notice by analysing the queries that WP is looking for the language “news” instead of the page “news”: https://snipboard.io/UBPbwj.jpg

    Can someone help me ?

    Thanks in advance, Cedric

    • This topic was modified 3 years, 6 months ago by Ced.
Viewing 1 replies (of 1 total)
  • This seems to be related to the language plugin filtering the query. You should ask in the plugin’s support forum.

Viewing 1 replies (of 1 total)
  • The topic ‘index.php used instead of custom template some times’ is closed to new replies.