Automattic / underscores.me

https://underscores.me
GNU General Public License v2.0
210 stars 118 forks source link

Problem width page templates - static pages displays content is from index.php #76

Closed serghiyH1 closed 4 years ago

serghiyH1 commented 4 years ago

Hello everybody. I have a problem with the my theme, help me please!!! Two days I can not understand what's the matter. Familiar with underscores and WordPress well - created a lot of custom themes. But at the moment I'm stuck - I had a problem with the theme for the artist's site, which I started developing recently. I will try to clarify the essence:\

There are different types of pages in my template. The home page has a separate template, and several more pages will have their own templates. The problem is that all pages except FrontPage (home) displays content from index.php. It doesn't matter if I specify my own template for page, or default template - page always use the index.php template.

It seems that WordPress does not see the template for pages. I tried to switch to standard WordPress themes (twentytwenty) - everything works as it should.

At first I thought maybe I made a mistake. I looked through all the files of the theme 10 times - I didn't find any errors.

The idea crept in that something was wrong with directly from underscores.

Then I generated a new theme at https://underscores.me/ - did not make any changes to the theme files, the result - the same error (pages are displayed with index.php). I installed the new WordPress and repeated the procedure again, to be sure. The result is the same, in the theme I created and a clean theme from underscores.me pages are displayed with index.php, and on native WordPress themes (like twentytwenty, twentynineteen) everything is fine - pages content displays from page.php.

I can't understand what the mistake is. Maybe I don't see something banal, I missed it? Maybe there is some incompatibility with the latest version of WordPress?

Here is some screenshots: Static home page

Screenshot

Simple page:

Screenshot

Sorry for my English, i still learning

serghiyH1 commented 4 years ago

decided to go through each theme file manually and after replacing each re-save "permlinks". Good thing I guessed to start with functions.php…

… After replacing functions.php with re-save “permlinks” - it worked !!!

And really everything turned out to be very prosaic )). The whole problem was in the custom taxonomy "year", which I created in my topic. He changed the name to "year-of-publishing" and everything worked. This name, damn, is reserved, and I knew about it and did not pay attention.

Surprisingly, after generating a new theme on underscores.me and installing it, the problem was transferred to it. Apparently, it was necessary to re-save the "permalinks" after activating the pure underscores theme. But when I activated the "default" WP theme, everything worked at once.

So friends, be careful not to "blunt" like me. Three days lost almost….