index.php used instead of custom template some times
-
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):
- FR: https://example.com/
- NL: /nl/
- EN: /en/
- DE: /de/
Site 2 (4 languages):
- FR: https://site2.example.com/
- NL: /nl/
- EN: /en/
- DE: /de/
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
- The topic ‘index.php used instead of custom template some times’ is closed to new replies.