Skip Navigation

[Resolved] Content template for CPT single post view not loading

This thread is resolved. Here is a description of the problem and solution.

Problem: My Content Template is not being displayed on my site. I have a Content Template assigned to my custom post type, and I also have a custom PHP template in my theme following standard WordPress Template hierarchy (single-slug.php).

Solution: Resave your site's Permalinks and try again.

100% of people find this useful.

This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by carlosB-2 7 years ago.

Assisted by: Christian Cox.

Author
Posts
#588832

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

#588944
Screen Shot 2017-11-12 at 11.51.04 AM.png

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.

#588960

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!