Answer the question
In order to leave comments, you need to log in
When setting up the CNC in /%postname%/, the hierarchy is not respected and index.php is loaded, instead of templates or page.php. Why is this happening?
When setting up the CNC in /%postname%/, the hierarchy is not respected and index.php is loaded, instead of templates or page.php. Why is this happening? The site is multilingual.
I also noticed this happens when the page does not have a parent, if I choose a parent, then everything is fine.
If you choose the URL type "Simple" ( site.ru/?p=123), then everything is fine.
The theme is custom, written from scratch, if you choose one of the standard ones, then everything is fine.
.htaccess standard:
# BEGIN WordPress
# Строки между `BEGIN WordPress` и `END WordPress` были созданы автоматически.
# Они могут быть изменены только фильтрами WordPress.
# Все изменения между этими отметками будут перезаписаны.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Answer the question
In order to leave comments, you need to log in
As it turned out, the problem was this:
I was registering a custom taxonomy with the "year" slug. And such a name is reserved by the engine.
Therefore, for some reason, it was the pages that flew. Although it is strange, if they were assigned a parent, they were displayed.
Solution: do not register custom taxonomies with reserved names: https://codex.wordpress.org/Reserved_Terms
Most likely, you messed up with the links and now the VP is confused about what should be loaded right now.
VP, forms links in such a way that you yourself do not get confused and understand that now you need a page and this one.
At this point, I would suggest starting a new site with a default theme and enabling/disabling plugins one by one in an attempt to reproduce this problem. This way you can eliminate the influence of your theme and find plugins that conflict.
And if the problem does not reproduce, then there is something with the theme or environment settings.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question