Skip Navigation

[Resolved] Content not showing on front page after deleting content from post type

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

Problem: When I try to see individual Author posts, a 404 error is shown.

Solution: The slug "author" is reserved in WordPress and should not be used as the slug for a custom post type. If you want to create an Authors custom post type, you must use a different slug. Then you can use Layouts to style the individual Author posts.

On the other hand, if you want to style the /author/ archives created automatically by WordPress, create an archive Layout or an archive Content Template and assign it to the author archive.

Relevant Documentation:
https://codex.wordpress.org/Function_Reference/register_post_type
https://toolset.com/documentation/user-guides/creating-wordpress-custom-post-archives/
https://toolset.com/documentation/getting-started-with-toolset/customize-post-archives/
https://toolset.com/documentation/getting-started-with-toolset/customize-post-archives/designing-archives-with-toolset-layouts/

This support ticket is created 5 years, 2 months 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.

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 8 replies, has 2 voices.

Last updated by hannahS 5 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#1363401
Screenshot 2019-10-17 at 14.36.13.png
Screenshot 2019-10-17 at 14.30.45.png

Hello!

I want to show the content from the custom field called "author". We had some custom field groups that we did not need anymore called "authorpages" and I deleted that post type. However, now a layout still seems to be connected to pages from the authorpages that prevents me from editing the layout to correctly show the author content. And I don't know how to unlink that template from the old post types that we no longer use.

#1363549
Screen Shot 2019-10-17 at 10.56.43 AM.png

Hi, can you tell me what happens when you hover over the link "Layout for Author Page"? Can you click the "Change Layout Usage" button? Can you click "Duplicate"?

#1363623
Screenshot 2019-10-17 at 18.04.28.png
Screenshot 2019-10-17 at 18.02.17.png

Hi Christian,

thanks for the fast reply.

I can click on duplicate. And I can also click the change layout usage button. I attached screenshots for the options I receive when I click on that.

#1363783

So if you can Duplicate the Layout, are you able to then set the correct Usage for the Duplicated item? You could just delete the old Layout and use the new Duplicate, right? Maybe I don't understand the problem completely.

#1364091
Screenshot 2019-10-18 at 11.56.07.png
Screenshot 2019-10-18 at 11.56.01.png
Screenshot 2019-10-18 at 11.55.50.png

Hey Christopher,

thanks for your help. I tried to duplicate the layout but my content still won’t show up on the front end.

I will try to explain my problem a bit more in detail. We have a custom type called “authors” to which I assigned a template. In the back-end I can see all the information but whenever I try to view the content on the front-end I get a “page cannot be found” error message. When I created the template for the first time for this custom type I got the message, that a layout is already assigned to this custom type.

When I go into my layouts I can see old templates that are still connected to post types, however, I deleted those post types so I am not sure how I can unlink them. I want to delete them because I think that maybe those templates are blocking my content from being shown. I am very new to toolsets so I am not sure if this is even the problem that prevents my content from being shown.

#1365591

Okay thanks for the additional information. It could have something to do with the deleted post types like you're saying, or it could be something completely different. Let's try a few more troubleshooting steps:
- Temporarily deactivate all plugins except Types, Views and Layouts, and activate a default theme like Twenty Nineteen.
- Go to wp-admin > Settings > Permalinks and resave your site permalinks. Test again. If the problem is resolved, reactivate your theme and plugins one by one, testing each time, until the problem returns.
- Edit one of the Author posts in wp-admin and tell me which Template Layout is selected for the post.
- Temporarily deactivate the Toolset Layouts plugin and test an Author post on the front-end again. Is it showing a "page not found" error, or a different error, or is a post appearing?

#1367129
Screenshot 2019-10-23 at 09.35.24.png
Screenshot 2019-10-23 at 09.34.42.png

Hi, thanks for all the suggestions. I followed all the steps but the problem still exists. I attached you screenshots showing the template that is in use and also the page not found error. The page not found error is the same when I deactivated the Toolset Layouts plugin.

#1367605
Screen Shot 2019-10-23 at 10.03.01 AM.png

"Author" is a reserved keyword in WordPress, so that's at least part of the issue with the 404 error. The custom post type slug "author" should not be used. I'm not sure how you set it up, because an error is shown when you try to add a custom post type with the slug "author" with Types (see the screenshot).
https://codex.wordpress.org/Function_Reference/register_post_type
In addition, the following post types should not be used as they interfere with other WordPress functions..
action
author
order
theme

I suspect this is why you also had a custom post type "authorpages", because "authorpages" is not a reserved keyword, and could be used to create individual posts for each Authorpage.

Normally the /author/ directory is reserved to show an archive of each User's posts. That archive can be designed with a WordPress Archive cell in an Archive Layout. So if you'd like to use the /author/ directory, I can show you how to set up an archive for each User at their own /author/userlogin URL. However, if you want to create a custom post type like "Authors", you must rename the slug to something other than "author", resave your site's permalinks, and go from there.

#1368521

Thanks a lot! This was actually the issue and it worked!