Hi there, something strange happened this week.
The client called and told me that all journal articles (post type) were missing a layout.
I checked in the backend and found that this post type was now assigned to a new empty layout. This layout was named exactly as the post type name (not the slug); "Layout for tijdschriftartikelen".
I am confused what could have happened the client did to make this happen...
Is there something they could have clicked on accident?
Any idea?
The only way I was able to reproduce something similar required re-saving all of the posts individually, and I'm not sure if your client would have done that.
It also requires you to have moved from using the Views plugin on your site to using Toolset Blocks instead.
The two are almost the same, but there is a difference on older sites if you are using Layouts.
With Blocks, when editing posts you no longer see a metabox to choose which Layout template is assigned; instead you see a metabox about which Content Template to assign to the post, only (see screenshot).
If you save the post in that case then, because the post edit screen lacks the Layout template metabox, no Layout is assigned.
So the advice if you are using Layouts is to persist with using Views rather than Toolset Blocks.
But I don't know what could have caused *all* journal articles to lose their Layout assigment, unless someone did something obvious like edit the Layout and remove the assignment to the post type. You can do the reverse and edit the Layout and assign to the post type to re-establish the templates.
Hi Nigels,
no the client would never have changed every article (there are more than a thousant).
I am using the old plugins with views and layouts, not the blocks version...
I already reasigned all articles to the right layout, that is not the problem here. Just the question how this could have happened.
I am also amazed by the how. And me too can only think of the obvious, but then again, that makes no sense...
Hello there! I can't think of another cause except for something related to a 3rd party component(theme/plugin). With the implementation of layouts and views, the assigned layout is stored per posts on a hidden custom field, maybe something on the server has removed that hidden custom fields for all the posts, and then you see the "Layout for tijdschriftartikelen" as assigned because it is probably the first element of the layouts dropdown.
From our side, we'll be pleased to investigate this issue if we could know the steps to reproduce it. Without these steps, we can only guess.
I understand completely, and I can reproduce it myself because I am not even sure what happened.
One more thing that might help is that I noticed that a few posts were linked to this layout. So not linked to the complete post type but just a few, probably assigned by hand...
Now I am not sure if this happened after all were removed from the layout as a means of repairing. Or that this has caused the problem -> he/she removed the layout from a single post accidentely (clicking "stop using this layout") and somehow activating this for all posts. Then manualy assigned a post to the layout again...
Sorry, just thinking out loud.
I understand if this does not help. And probably it doesn't matter and won't happen again anyway. And if it does, then maybe I'll have more info.
Of course, if it happens again, we should analyze it and find out why, and of course, fix it. If it happens again, let us know and share a copy of your website with us. We'll remain at your disposal.
Thnx Jamal,
my remark did not ring a bell to bring us closer to the cause of this problem?
See my last reply:
"One more thing that might help is that I noticed that a few posts were linked to this layout. So not linked to the complete post type but just a few, probably assigned by hand..."
Hello Jim, I am sorry, but it did not ring a bell for me.
Layouts can be assigned to a whole custom post type, or they can be assigned to specific posts. When a layout is assigned to a custom post type, the posts from that custom type can still be assigned to different layouts. I assumed that those posts were set to use that layout.