Question

Update: After further inspection it appears that the pages that were effected are being created as "Archive" pages, but there is no archive.php file so they are using index.php. Why would my pages become archive pages when they have custom page-{slug} templates, and how do I fix this?


(Earlier. . .) My theme was installed and has been working properly for a couple of weeks now, until I accidentally activated and deactivated WP Super Cache.

My theme includes custom post types that are populated on page templates (i.e. I have a page titled "Careers" which uses the page-careers.php template, and runs a query to show all of the posts with a custom post type of "job"). This was working just fine, previously.

Yesterday, I installed WP Super Cache and accidentally activated it. Since I did not mean to activate it, I quickly deactivated it and got the following error (I've replaced my actual username with "myusername"):

Warning: include(/home/myusername/test.rocquemoremedia.com/wp-content/wp-cache.config.php): failed to open stream: No such file or directory in /home/myusername/test.rocquemoremedia.com/wp-content/plugins/wp-super-cache/wp-cache-phase1.php on line 7

Warning: include(): Failed opening '/home/myusername/test.rocquemoremedia.com/wp-content/wp-cache-config.php' for inclusion (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear') in /home/myusername/test.rocquemoremedia.com/wp-content/plugins/wp-super-cache/wp-cache-phase1.php on line 7

The error seemed to resolve itself and I was redirected back to the admin site, but when I went to view the site, I noticed that all the pages that were using custom page templates are now just using my index.php template, with the exception being the "Home" page and the "Contact" page. And, I believe the only reason the "Home" and "Contact" pages are okay is because neither of them use the loop to show posts.

I would like to know what I did wrong, and how I can get my pages back to their respective page templates.

Was it helpful?

Solution

The issue was my page slugs were the same as my custom post type slugs, which was confusing WordPress. It caused Wordpress to use the index.php file to create my pages, or have a 404 error for my custom posts, if the pages worked.

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top