I am trying to: use a content template for the single post view for my CPT Workshops. I have a Content Template that's assigned to the Workshops CPT. I'm also using a WP template file, called single-workshops.php so I'm expecting that template file to load, and call the Content Template, but instead I'm getting the index.php file loading, and it's not displaying any content... it's just partially rendered.
I have a STAGING version of this site, where I developed the site, and everything works fine there. It's the LIVE site where this is not working. I've checked everything I can think of, and everything is the same on both sites, except for the data.
Link to a page where the issue can be seen:
hidden link
Click an underlined link in the first column...
I expected to see: the single view for the Workshop clicked.
Instead, I got: a partially rendered page, that's not using the single-workshops.php file or the Content Template assigned to it. Instead, it's loading index.php, but the loop isn't running...
You can see the how it SHOULD work, on the STAGING site:
hidden link
And see that by clicking a workshop title in the first column, that you go to the workshop single view page.
Thanks for any help
Hi, when I load the Workshop single post URL, I see an error message in the page title "Page not found". This indicates that you're actually receiving a 404 error on this page, but the 404 page template (404.php) isn't complete or doesn't exist, so you're not seeing the error message displayed in the page content. So definitely check the 404 template to ensure it's set up to display the appropriate error for your users. Similar blank 404 shown on staging:
hidden link
But...that's not the main issue here, there's something else going on. Please try the following troubleshooting steps to help narrow down the issue:
- Go to Settings > Permalinks and resave your site permalinks. Retest.
- Temporarily activate a default theme like Twenty Seventeen and deactivate all plugins except Types. Save permalinks again and retest. If you need to activate a plugin like Maintenance Mode while you're testing that's fine.
- If the problem was resolved, reactivate your theme and other plugins one by one until the conflict is revealed.
- If the problem was not resolved, turn on server logs, refresh a Workshop page, and copy + paste any server-side errors here for me to review. If you're not familiar with server logs, I can explain how to enable them. Go in your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:
define('WP_DEBUG', true);
Then add these lines, just before it says 'stop editing here':
ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
Refresh a Workshop page. If any server-side errors are thrown, a file will be created in your site's root directory called "error_log.txt". Provide its contents here in your reply. Then you can revert the changes you made to wp-config.php.
Hi Christian-
Thanks for the support over the weekend. I appreciate your pointing out the missing 404.php file. I've created one now.
I tried your first suggestion as far as my main problem - resetting permalinks, and that worked, so all is good right now.
Thanks again!