Frage

Issue: The root index.php file is showing up instead of my created template-name.php.

What I have done to try and fix: Delete and create a new reviews page with the routename of "reviews". Check my template-page.php to see if I forgot something.
Changed the template to the default template for the reviews page and it gives the same index.php.

Other Important Info:

I have a development environment where the routename works (www.developmentsite.test/reviews), and shows my template-page.
I have also created a page, with a different route, on my production site that uses the review template-page I created and works as well(www.productionsite.com/test-page).

What I need help with: I need (www.productionsite.com/reviews) to show my template-page that I created.

What I think is the issue: There is something wrong with the routename /reviews because even creating a brand new page with that routename, it gives me the index.php root file while using any other routenames, it gives me my default page.php file.

War es hilfreich?

Lösung

In your comment you mentioned that you had a reviews post type. This means that /reviews/ will be the default URL for listing that post type, and this will use index.php as per the template hierarchy. If you're trying to list reviews, then my first suggestion would be to just use the post type archive, and create archive-reviews.php to markup and style them.

If you do ultimately need a static page that list reviews, rather than the post type archive, then set the has_archive property of the post type to false. Then /reviews/ won't exist anymore, and you can use it as the slug for a new page instead.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit wordpress.stackexchange
scroll top