I just realized that at least since version 22.214.171.124.5 my archive pages are broken.
For my archive pages I use the default template option like this: Themer > Templates > + Default > and then I select the archive for my CPT.
Also I have a general archive page that is used when there is no specific archive available.
For some reason when I view the archive in the frontend Cwicly is no longer using the archive that I created for the CPT rather than the fall back template.
(this “Template: Archive” is the fallback template. It should say “Template: CPT”)
On top of this the fallback template does not get rendered correctly resulting in a completely destroyed page.
When I create a custom template and target the archive of my CPT however it works as it should.
I tried this on three different installations and had the same result everywhere.
Step-by-step reproduction instructions:
- Create a CPT with an archive
- create an archive template for your CPT like this: Themer > Templates > + Default > your CPT
- create a default fallback template for all archives
- now visit your CPT archive and check what template is being used
It seems this only happens for archives that are created before the fallback template.
So if I would have created the fallback archive first everything would work fine.
how do you access your archive/ set your conditioning for an archive?
I just tried to create a template and connect it to my archive but was not able to with the Archive condition below.
I did not select any conditions since I used the default template option. this works without using conditions.
So it appears that it works as soon as I also select a condition. I’ve never done this and somehow didn’t even try this
But until a few versions ago it worked this way so there was no need for custom visibility conditions.
Anyway, thanks for pointing this out! This takes the urgency away from this one
Now that I think about it it also could be that this happened because of a WordPress update. That’s actually most certainly the cause of this issue. So I’ll just use the conditions from now on.
Sorry for the drama
Glad you found a solution to your problem
But can you actually connect a template to an archive? My comment was meant as a confirmation to your bug… So I’d be really interested to know how you made your connection, since mine isn’t working.
Did you create a custom template or a default template?
Your conditions target all archives. For my template that is meant for all archives (where I did not create a specific template for) I still don’t use any visibility conditions. I just create a default template:
Themer > Templates > + Default > All Archives
Now when I have a CPT archive where I don’t wont the standard template I again go to:
Themer > Templates > + Default > CPT Archive
and create the template.
What’s new now is that I also need to select the following visibility condition:
This way the CPT Archive is only used on the CPT archive while the fallback archive is used everywhere else.
I was just testing to see if I could even see my template on an archive page.
I have never used the default templates
As far as I know, the only difference between default templates and custom templates is that the visibility conditions are preset.
So if I create a custom template that has the
Show if -> Archive -> All condition, I expect it to show up in all my archives…
This is not the case for me.
I use the CPTs from ACF
I believe the default templates are the ones that come with the theme or WordPress. When you create a custom one you just overwrite the default template. When you create a default template it will alter the default template that comes with the theme.
It should show up. Are there any other templates that are assigned to some of your archives?
I also use CPT with ACF
I have turned off the visibilety conditions of my other templates, so there should be no interference?
Well, I will test this later during a clean install
will report back
Since you use custom templates I don’t think there can be any interference. I mean a custom template without any conditions is not shown anywhere.
Please do so! Would be interested to know what the issue was.
So here is my brand new local installation where I created an ACF CPT and filled it with 5 posts.
Then creating a custom template for that archive
Adding my awesome design to that template:
Setting the condition to all to check if the design is displaying correctly:
Which is working:
Setting the conditions of the template to show on all archives:
Which leaves my page empty:
By creating a default template for all archives:
Creating another awesome design for the teplate:
And the result is, that it is not displaying on my page:
Any ideas for a fix? Is there an error somewhere? Or is this a real bug?
Did you turn on the archive?
Of course not… why would I turn on the archive?
Thank you @Jonas, that did the trick
Forgot with time that these two are not the same
Yep, some times the solution is very obviously hidden
Happy to hear everything is working now.